mirror of
https://github.com/grobo021/snap-nuke.git
synced 2025-02-22 09:12:02 +00:00
Update snap-nuke.sh
Improve clarity and simplify `nosnap.pref` creation
This commit is contained in:
parent
e203ec6169
commit
5c5d24c22f
@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [[ "$EUID" == 0 ]]
|
if [[ "$EUID" == 0 ]]; then
|
||||||
then
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
┌──────────────────────────────────────────────────────────────────────┐
|
┌──────────────────────────────────────────────────────────────────────┐
|
||||||
│Please don't run this script as root as it may break you system. │
|
│Please don't run this script as root as it may break you system. │
|
||||||
@ -22,7 +21,7 @@ cat << EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Do you wish to run the script? " yn
|
read -p "Do you wish to run the script? [y/n] " yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) break;;
|
[Yy]* ) break;;
|
||||||
[Nn]* ) exit;;
|
[Nn]* ) exit;;
|
||||||
@ -40,14 +39,12 @@ do
|
|||||||
sudo umount $I
|
sudo umount $I
|
||||||
done
|
done
|
||||||
|
|
||||||
cat << EOF > nosnap.pref
|
sudo tee /etc/apt/preferences.d/nosnap.pref << EOF > /dev/null
|
||||||
Package: snapd
|
Package: snapd
|
||||||
Pin: release a=*
|
Pin: release a=*
|
||||||
Pin-Priority: -10
|
Pin-Priority: -10
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo mv nosnap.pref /etc/apt/preferences.d/nosnap.pref
|
|
||||||
|
|
||||||
sudo apt-get purge snapd
|
sudo apt-get purge snapd
|
||||||
rm -rf ~/snap
|
rm -rf ~/snap
|
||||||
sudo rm -rf /snap
|
sudo rm -rf /snap
|
||||||
|
Loading…
x
Reference in New Issue
Block a user