linutil/tabs/system-setup/4-remove-snaps.sh
2024-09-17 18:12:06 +05:30

31 lines
692 B
Bash

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