linutil/core/tabs/system-setup/remove-snaps.sh

31 lines
722 B
Bash
Raw Normal View History

2024-08-05 21:03:42 +01:00
#!/bin/sh -e
. ../common-script.sh
2024-08-05 21:03:42 +01:00
removeSnaps() {
2024-09-17 13:23:23 +01:00
case "$PACKAGER" in
2024-08-05 21:03:42 +01:00
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
2024-08-05 21:03:42 +01:00
;;
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd
2024-08-05 21:03:42 +01:00
if [ "$ID" = ubuntu ]; then
"$ESCALATION_TOOL" apt-mark hold snapd
2024-08-05 21:03:42 +01:00
fi
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
2024-08-05 21:03:42 +01:00
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
2024-08-05 21:03:42 +01:00
;;
*)
printf "%b\n" "${RED}Removing snapd not implemented for this package manager${RC}"
2024-08-23 14:12:47 +01:00
;;
2024-08-05 21:03:42 +01:00
esac
}
checkEnv
2024-08-23 14:12:47 +01:00
checkEscalationTool
2024-08-05 21:03:42 +01:00
removeSnaps