Unable to install Nvidia drivers on Ubuntu 18.04.1

Ok, as of now many of the bugs related to this issue (NVIDIA Graphics) have been fixed and the installation procedure is fairly easy. (I would recommend you to have a fresh start, and then apply this procedure)

1.Entering Grub Boot Parameters - This can be done by going to the grub menu at boot (press Esc or Shit at boot) here press e.
2. Enabling Text Mode Booting - Here add a 3 after quiet splash and press F10 to reboot using the new parameters.
3. Purge NVIDIA- Now login to the text only mode, and purge all the NVIDIA drivers completely using the sudo apt-get remove --purge nvidia*, and reboot. While rebooting follow step 1, here edit the parameters and add the command nomodeset before qiet splash, and press F10 to reboot the using the new parameters.
4. Installing Nvidia Drivers- once in the system run commands in the terminal sudo apt-get update and sudo apt-get upgrade now.

  1. Add the drivers repository to Ubuntu, run the commands sudo add-apt-repository ppa:graphics-drivers/ppa and sudo apt update.
    Now, do not update graphic drivers via the terminal, instead search for Software & Updates in the Ubuntu GUI. here go to the additional drivers tab. Here you will find the set of NVIDIA drivers for your system. select the nvidia-drivers-415 i think that one is the latest. (Make sure that you do not select or keep selection in Using X.Org X server - selection)
  2. The installation will take a while once the installation is complete, reboot the system.
  3. Now it isn't necessary to add nomodeset to boot parameters, the Ubuntu Os should boot properly and without any error.
  4. If you have added nomodeset parameters to Grub, remove it in this step and keep the quiet splash parameter alone.(or else nvidia driver wont load)
  5. Once you have completed the login, enter the Ubuntu desktop, search for the NVIDIA Xserver application, to monitior the nvidia GPU.

Something to note that took me a very long time to realize: first:

sudo apt-get purge nvidia*  
sudo apt-add-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-driver-xxx

you will be asked to enter a password. during the install ( read the content carefully ) then

reboot

on start up you must enroll the mok. basically click enter and try to get to a place where you are asked for the password you entered after install. Only then will the driver actually work.