From 20e15ea886328cbc5cb8ae9523daa9fecc51cbfa Mon Sep 17 00:00:00 2001 From: Will Date: Sun, 23 Apr 2023 11:41:29 -0400 Subject: [PATCH] added remove_tool.sh --- remove_tool.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 remove_tool.sh diff --git a/remove_tool.sh b/remove_tool.sh new file mode 100755 index 0000000..1b64186 --- /dev/null +++ b/remove_tool.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +#this tool will purge/remove all remnant objects from a failed/bad nvidia driver installation - use with caution, can put your endpoint in an unstable state. DO NOT REBOOT until you've reinstalled a graphics driver + +echo "this script must be run with sudo" +echo "press return to start; and you may choose whether to purge/keep packages as they are listed" + +for i in $(dpkg -l | grep nvidia | awk {'print $2'}); do echo $i; apt-get --purge remove $i; done + +echo "packages removed, you must now reinstall a driver and then run:" +echo "sudo update-initramfs -u" +echo "note further that you *may* wish to run `sudo apt autoremove` but this will purge packages that may be in a pending state *until* you install the next driver." +echo "better to wait and reinstall a driver then see what remains to cleanup" +