Skip to content

Instantly share code, notes, and snippets.

@thaddeusc1
Last active November 16, 2021 15:02
Show Gist options
  • Select an option

  • Save thaddeusc1/a614b1d29df336f738a95b87419ed491 to your computer and use it in GitHub Desktop.

Select an option

Save thaddeusc1/a614b1d29df336f738a95b87419ed491 to your computer and use it in GitHub Desktop.
CLI install NVIDIA proprietary driver updates for Ubuntu 20.04 LTS after OS install

CLI install NVIDIA proprietary driver updates for Ubuntu 20.04 LTS after OS install

Problem

After installing Ubuntu 20.04 LTS on a laptop with an NVIDIA GPU, the user is presented with only a blinking cursor on the laptop's display when first booting into the newly installed OS.

The problem described above could occur when the Nvidia proprietary driver included with the Ubuntu 20.04 LTS installer is not the latest available driver.

  • Therefore, the latest driver needs to be installed via CLI.

Used on the Dell G15 (5511) laptop to install the latest Ubuntu drivers for Nvidia's GA106M (RTX 3060 Laptop) and GA107M (RTX 3050/3050 Ti Laptop) GPUs.

Prerequsites

Run this script from a login shell

e.g., If no graphical login appears;

  • switch to virtual terminal 3 (^⎇F3),
  • login at the shell on the virtual terminal.
#!/usr/bin/env bash
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# Install OS and software updates
sudo apt update
sudo apt -y upgrade
# Upgrade "Additional drivers" provided through Ubuntu
sudo ubuntu-drivers install
# Reboot once updates are installed
sudo shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment