| Action | Command | Outcome |
|---|---|---|
| Purge Drivers | sudo apt-get purge nvidia* |
Removes all NVIDIA-related packages and configs. |
| Cleanup | sudo apt autoremove |
Deletes unused dependencies. |
| Reboot | sudo reboot |
Applies changes and returns to default Nouveau drivers. |

What is Removing NVIDIA Drivers from Terminal on Ubuntu 24.04?
Removing NVIDIA drivers from the terminal is a critical recovery process for Ubuntu 24.04 users facing “Login Failed” loops or black screen errors. It involves using the Command Line Interface (CLI) to uninstall proprietary graphics software.
When a driver update fails or becomes incompatible with the Linux kernel, the Graphical User Interface (GUI) often stops loading. Using the terminal allows you to bypass the broken desktop environment to fix the underlying issue.
Step-by-Step Solutions
1. Access the Terminal (TTY Mode)
If you are stuck at the login screen and cannot enter your desktop, you must switch to a Virtual Console. Press Ctrl + Alt + F3 (or F4/F5) on your keyboard.
Log in with your Ubuntu username and password. Note that the password will not show characters as you type for security reasons.
2. Purge All NVIDIA Packages
The most effective way to fix a broken driver installation is a complete purge. This command removes every package associated with NVIDIA to ensure no conflicts remain.
sudo apt-get purge nvidia*
Once the process begins, press ‘Y’ and Enter to confirm the removal of the drivers.
3. Remove Residual Dependencies
After purging the main drivers, Ubuntu might still have orphaned dependencies or configuration files that could interfere with a clean reboot.
sudo apt autoremove
sudo apt autoclean
4. Disable Third-Party Repositories (Optional)
If you used a PPA (Personal Package Archive) to install the drivers, it is often safer to remove the repository to prevent Ubuntu from trying to reinstall the same broken version.
sudo add-apt-repository --remove ppa:graphics-drivers/ppa
sudo apt update
5. Reboot the System
Finally, restart your computer. Ubuntu 24.04 will automatically fall back to the open-source “Nouveau” drivers, which should allow you to reach the login screen and desktop successfully.
sudo reboot