2024-08-05 21:03:42 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2024-08-15 07:13:56 +01:00
|
|
|
. ../common-script.sh
|
2024-08-05 21:03:42 +01:00
|
|
|
|
|
|
|
removeSnaps() {
|
2024-10-04 11:39:41 +01:00
|
|
|
if command_exists snap; then
|
|
|
|
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|zypper)
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2024-10-04 18:29:28 +01:00
|
|
|
printf "%b\n" "${GREEN}Successfully removed snaps.${RC}"
|
2024-10-04 11:39:41 +01:00
|
|
|
else
|
2024-10-04 18:29:28 +01:00
|
|
|
printf "%b\n" "${GREEN}Snapd is not installed.${RC}"
|
2024-10-04 11:39:41 +01:00
|
|
|
fi
|
2024-08-05 21:03:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
checkEnv
|
2024-08-23 14:12:47 +01:00
|
|
|
checkEscalationTool
|
2024-08-05 21:03:42 +01:00
|
|
|
removeSnaps
|