Skip to content

Instantly share code, notes, and snippets.

@hitorilabs
Last active November 2, 2023 18:48
Show Gist options
  • Save hitorilabs/3fed1a6e5dd500edb5ad7568562c064d to your computer and use it in GitHub Desktop.
Save hitorilabs/3fed1a6e5dd500edb5ad7568562c064d to your computer and use it in GitHub Desktop.

If you follow nvidia's instructions for removing packages, you get stuck in a debugging loop where it says "following packages have unmet dependencies".

For some reason nvidia drivers installed through the default Ubuntu installer is always broken, so you'll need to get force purge these dependencies in order to continue.

sudo dpkg --force-all -P <package_name>

Alternatively, apt --fix-broken install can get you to the point where you can just apt remove all the packages.

As a bonus, you can also get away without rebooting your machine by removing the kernel modules from sudo lsmod | grep nvidia using rmmod (typically nvidia_drm -> nvidia_modeset -> nvidia). Then load the correct modules back in by just running nvidia-smi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment