From d36a6459a3e282f951f49e7b7f360ef3f6c692d4 Mon Sep 17 00:00:00 2001 From: Stanislas Lange Date: Sun, 22 Jan 2023 15:44:31 +0100 Subject: [PATCH] Don't auto remove dependencies when uninstalling Fix https://github.com/angristan/wireguard-install/issues/301 --- wireguard-install.sh | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 79dd829..631ff63 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -431,28 +431,22 @@ function uninstallWg() { systemctl disable "wg-quick@${SERVER_WG_NIC}" if [[ ${OS} == 'ubuntu' ]]; then - apt-get autoremove --purge -y wireguard qrencode + apt-get remove -y wireguard wireguard-tools qrencode elif [[ ${OS} == 'debian' ]]; then - apt-get autoremove --purge -y wireguard qrencode + apt-get remove -y wireguard wireguard-tools qrencode elif [[ ${OS} == 'fedora' ]]; then - dnf remove -y wireguard-tools qrencode + dnf remove -y --noautoremove wireguard-tools qrencode if [[ ${VERSION_ID} -lt 32 ]]; then - dnf remove -y wireguard-dkms + dnf remove -y --noautoremove wireguard-dkms dnf copr disable -y jdoss/wireguard fi - dnf autoremove -y - elif [[ ${OS} == 'almalinux' ]]; then - dnf -y remove wireguard-tools qrencode + elif [[ ${OS} == 'centos' ]] || [[ ${OS} == 'almalinux' ]] || [[ ${OS} == 'rocky' ]]; then + yum remove -y --noautoremove wireguard-tools if [[ ${VERSION_ID} == 8* ]]; then - dnf -y remove kmod-wireguard + yum remove --noautoremove kmod-wireguard qrencode fi - dnf -y autoremove - elif [[ ${OS} == 'centos' ]]; then - yum -y remove kmod-wireguard wireguard-tools qrencode - yum -y autoremove elif [[ ${OS} == 'oracle' ]]; then - yum -y remove wireguard-tools qrencode - yum -y autoremove + yum remove --noautoremove wireguard-tools qrencode elif [[ ${OS} == 'arch' ]]; then pacman -Rs --noconfirm wireguard-tools qrencode fi