#!/bin/bash # ! This script assumes you're using a Debian-based system like Ubuntu. # Set execution permissions: chmod +x uninstall_nvidia.sh # Run script: sudo ./uninstall_nvidia.sh echo "Identifying installed NVIDIA packages..." dpkg --list | grep nvidia echo "Purging NVIDIA packages..." sudo apt-get purge nvidia-* echo "Removing leftover NVIDIA configuration files..." sudo apt-get autoremove # Optional: Install a specific version of the NVIDIA driver # Uncomment and replace with your desired version. # echo "Installing NVIDIA driver version ..." # sudo apt-get install nvidia-driver- echo "Cleaning up..." sudo apt-get autoclean sudo apt-get clean echo "Rebooting system..." sudo reboot