add option to remove snaps

This commit is contained in:
cpunerd 2024-08-05 15:03:42 -05:00
parent 6f865f76ef
commit 7609d755a7

View File

@ -0,0 +1,28 @@
#!/bin/sh -e
. ./common-script.sh
removeSnaps() {
case $PACKAGER in
pacman)
sudo ${PACKAGER} -Rns snapd
;;
apt-get|nala)
sudo ${PACKAGER} autoremove --purge snapd
if [ "$ID" = ubuntu ]; then
sudo apt-mark hold snapd
fi
;;
dnf)
sudo ${PACKAGER} remove snapd
;;
zypper)
sudo ${PACKAGER} remove snapd
;;
*)
echo "removing snapd not implemented for this package manager"
esac
}
checkEnv
removeSnaps