I'm new to linux and I decided to install Debian 9, I installed it in my HDD in UEFI mode with a USB stick and the DVD 1 iso found here: https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/. I had some issues with network drivers but I managed to solve them. Then I wanted to install Nvidia propietary drivers, my laptop is a MSI GL62-7RDX which comes with an i7-7700HQ CPU and a GTX 1050 (2GB) graphics card, I followed the steps specified here: https://wiki.debian.org/NvidiaGraphicsDrivers#Debian_9_.22Stretch.22 which are:
- Add non-free repositories by modifying the sources.list file.
Execute the following commands as root:
apt update apt install linux-headers-$(uname -r|sed 's/[^-]*-[^-]*-//') nvidia-driver
The problem is that when I rebooted I only got a black screen with a blinking cursor. I decided to follow the steps shown here: https://wiki.debian.org/NvidiaGraphicsDrivers#Backing_out_in_case_of_failure in order to throw back the changes. After rebooting I could see the login screen, but when I tried to login I got a login loop, despite of the password being correct.
I also tried to install Nvidia drivers as shown here: How to install the latest NVIDIA drivers on Debian 9 Stretch Linux but I got black screen with blinking cursor again.
In summary, I would like to know how to properly install Nvidia drivers in my laptop. I think I am missing something and that the problem is related to my specific hardware, because a few days ago I tried to install Ubuntu 17.10 and it only worked if I added nomodeset by pressing e in the GRUB.