mirror of
https://github.com/grobo021/snap-nuke.git
synced 2026-07-13 19:10:28 +00:00
unlicense
This commit is contained in:
+42
-2
@@ -1,12 +1,43 @@
|
||||
#!/bin/bash
|
||||
if [[ "$EUID" == 0 ]]
|
||||
then
|
||||
cat << EOF
|
||||
┌──────────────────────────────────────────────────────────────────────┐
|
||||
│Please don't run this script as root as it may break you system. │
|
||||
│We will ask you for the password if we need root access. │
|
||||
└──────────────────────────────────────────────────────────────────────┘
|
||||
┬─┬ ノ( ゜-゜ノ)
|
||||
EOF
|
||||
exit
|
||||
fi
|
||||
|
||||
cat << EOF
|
||||
┌──────────────────────────────────────────────────────────────────────┐
|
||||
│This Bash Script is made by u/Techno021 to nuke snaps from Ubuntu. │
|
||||
│ │
|
||||
│Note: This has only been tested on Ubuntu 20.04 LTS, and may not work │
|
||||
│as intended on other versions. I will not be responsible for any │
|
||||
│damage if this script breaks your pc │
|
||||
└──────────────────────────────────────────────────────────────────────┘
|
||||
EOF
|
||||
|
||||
while true; do
|
||||
read -p "Do you wish to run the script? " yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
|
||||
sudo snap remove $(snap list | awk '!/^Name|^core|^bare|^snapd/ {print $1}')
|
||||
sudo snap remove $(snap list | awk '/^bare/ {print $1}')
|
||||
sudo snap remove $(snap list | awk '/^core/ {print $1}')
|
||||
sudo snap remove $(snap list | awk '/^snapd/ {print $1}')
|
||||
|
||||
for VARIABLE in $(df -h | awk '/snap/ {print $6}')
|
||||
for I in $(df -h | awk '/snap/ {print $6}')
|
||||
do
|
||||
sudo umount $VARIABLE
|
||||
sudo umount $I
|
||||
done
|
||||
|
||||
sudo cp nosnap.pref /etc/apt/preferences.d/nosnap.pref
|
||||
@@ -16,3 +47,12 @@ rm -rf ~/snap
|
||||
sudo rm -rf /snap
|
||||
sudo rm -rf /var/snap
|
||||
sudo rm -rf /var/lib/snapd
|
||||
|
||||
cat << EOF
|
||||
┌─────────────────────────────────────────────────────────────────────┐
|
||||
│All Done! This script has succesfully completed, please reboot so │
|
||||
│that changes take effect. │
|
||||
└─────────────────────────────────────────────────────────────────────┘
|
||||
(╯°□°)╯︵ ┴─┴
|
||||
EOF
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user