From 7609d755a7d58b0009185739435c0c10e0fa0dab Mon Sep 17 00:00:00 2001 From: cpunerd Date: Mon, 5 Aug 2024 15:03:42 -0500 Subject: [PATCH] add option to remove snaps --- src/commands/system-setup/4-remove-snaps.sh | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/commands/system-setup/4-remove-snaps.sh diff --git a/src/commands/system-setup/4-remove-snaps.sh b/src/commands/system-setup/4-remove-snaps.sh new file mode 100644 index 00000000..c839e4f0 --- /dev/null +++ b/src/commands/system-setup/4-remove-snaps.sh @@ -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