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

31 lines
710 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() {
case $PACKAGER in
pacman)
2024-08-23 14:12:47 +01:00
$ESCALATION_TOOL ${PACKAGER} -Rns snapd
2024-08-05 21:03:42 +01:00
;;
apt-get|nala)
2024-08-23 14:12:47 +01:00
$ESCALATION_TOOL ${PACKAGER} autoremove --purge snapd
2024-08-05 21:03:42 +01:00
if [ "$ID" = ubuntu ]; then
2024-08-23 14:12:47 +01:00
$ESCALATION_TOOL apt-mark hold snapd
2024-08-05 21:03:42 +01:00
fi
;;
dnf)
2024-08-23 14:12:47 +01:00
$ESCALATION_TOOL ${PACKAGER} remove snapd
2024-08-05 21:03:42 +01:00
;;
zypper)
2024-08-23 14:12:47 +01:00
$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