mirror of
				https://github.com/grobo021/snap-nuke.git
				synced 2025-11-04 10:47:00 +00:00 
			
		
		
		
	unlicense
This commit is contained in:
		
							
								
								
									
										24
									
								
								LICENSE.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								LICENSE.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
This is free and unencumbered software released into the public domain.
 | 
			
		||||
 | 
			
		||||
Anyone is free to copy, modify, publish, use, compile, sell, or
 | 
			
		||||
distribute this software, either in source code form or as a compiled
 | 
			
		||||
binary, for any purpose, commercial or non-commercial, and by any
 | 
			
		||||
means.
 | 
			
		||||
 | 
			
		||||
In jurisdictions that recognize copyright laws, the author or authors
 | 
			
		||||
of this software dedicate any and all copyright interest in the
 | 
			
		||||
software to the public domain. We make this dedication for the benefit
 | 
			
		||||
of the public at large and to the detriment of our heirs and
 | 
			
		||||
successors. We intend this dedication to be an overt act of
 | 
			
		||||
relinquishment in perpetuity of all present and future rights to this
 | 
			
		||||
software under copyright law.
 | 
			
		||||
 | 
			
		||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
			
		||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 | 
			
		||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 | 
			
		||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 | 
			
		||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 | 
			
		||||
OTHER DEALINGS IN THE SOFTWARE.
 | 
			
		||||
 | 
			
		||||
For more information, please refer to <https://unlicense.org>
 | 
			
		||||
							
								
								
									
										24
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
# Snap Nuke
 | 
			
		||||
This script nukes the snap package manager 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.
 | 
			
		||||
 | 
			
		||||
If you really want a snap-less Ubuntu that is guaranteed to not break,
 | 
			
		||||
you may want to try [Pop!_OS](https://pop.system76.com/) or [Linux Mint](https://linuxmint.com/)
 | 
			
		||||
 | 
			
		||||
If you are a server administrator, I highly advise against running this script, since it hasn't
 | 
			
		||||
been tested on Ubuntu Server. Please use Debian Testing instead. It's basically normal Debian but
 | 
			
		||||
the packages are more up to date. This is also what Ubuntu uses as a baseline to build on top of.
 | 
			
		||||
 | 
			
		||||
## Run the script
 | 
			
		||||
```bash
 | 
			
		||||
git clone https://github.com/grobo021/snap-nuke/
 | 
			
		||||
cd snap-nuke
 | 
			
		||||
./snap-nuke.sh
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Legal
 | 
			
		||||
This repository is under the [unlicense](LICENSE.txt) license. You are free to use this however you want,
 | 
			
		||||
but we are NOT providing any warranty that the script wont break the system. You have been warned.
 | 
			
		||||
							
								
								
									
										44
									
								
								snap-nuke.sh
									
									
									
									
									
								
							
							
						
						
									
										44
									
								
								snap-nuke.sh
									
									
									
									
									
								
							@@ -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