From e7fc8dd4f2589c7d4c05048dedc13fb81d8491ec Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Sat, 19 Jun 2021 21:06:36 +0200 Subject: [PATCH] more apt fixes (#2028) Signed-off-by: enoch85 --- addons/harden-ssh.sh | 2 +- addons/security.sh | 6 +++--- apps/clamav.sh | 6 +++--- apps/extract.sh | 2 +- apps/fail2ban.sh | 2 +- apps/midnight-commander.sh | 2 +- apps/previewgenerator.sh | 4 ++-- apps/talk.sh | 2 +- apps/whiteboard.sh | 4 ++-- disk/smart-monitoring.sh | 4 ++-- network/ddclient-configuration.sh | 4 ++-- network/geoblock.sh | 2 +- nextcloud_install_production.sh | 2 +- nextcloud_update.sh | 4 ++-- not-supported/bitlocker-mount.sh | 6 +++--- not-supported/pi-hole.sh | 4 ++-- not-supported/plexmediaserver.sh | 2 +- not-supported/remotedesktop.sh | 12 ++++++------ not-supported/tpm2-unlock.sh | 2 +- static/docker_overlay2.sh | 2 +- 20 files changed, 37 insertions(+), 37 deletions(-) diff --git a/addons/harden-ssh.sh b/addons/harden-ssh.sh index 1c42dcf6..77edb3bb 100644 --- a/addons/harden-ssh.sh +++ b/addons/harden-ssh.sh @@ -49,7 +49,7 @@ else rm -f "/home/$UNIXUSER/.google_authenticator" if is_this_installed libpam-google-authenticator then - apt purge libpam-google-authenticator -y + apt-get purge libpam-google-authenticator -y apt-get autoremove -y fi # Show successful uninstall if applicable diff --git a/addons/security.sh b/addons/security.sh index 8e79a61e..bc42d05a 100644 --- a/addons/security.sh +++ b/addons/security.sh @@ -33,7 +33,7 @@ else # Ask for removal or reinstallation reinstall_remove_menu "$SCRIPT_NAME" # Removal - apt purge libapache2-mod-evasive -y + apt-get purge libapache2-mod-evasive -y rm -rf /var/log/apache2/evasive rm -f "$ENVASIVE" a2dismod reqtimeout @@ -47,7 +47,7 @@ fi # Protect against DDOS apt-get update -q4 & spinner_loading -apt -y install libapache2-mod-evasive +install_if_not libapache2-mod-evasive mkdir -p /var/log/apache2/evasive chown -R www-data:root /var/log/apache2/evasive if [ ! -f "$ENVASIVE" ] @@ -65,7 +65,7 @@ ENVASIVE fi # Protect against Slowloris -#apt -y install libapache2-mod-qos +#install_if_not libapache2-mod-qos a2enmod reqtimeout # http://httpd.apache.org/docs/2.4/mod/mod_reqtimeout.html cat << SPAMHAUS_ENABLE > "$SCRIPTS/spamhaus_cronjob.sh" diff --git a/apps/clamav.sh b/apps/clamav.sh index 77add42f..8821e77e 100644 --- a/apps/clamav.sh +++ b/apps/clamav.sh @@ -28,9 +28,9 @@ else # Ask for removal or reinstallation reinstall_remove_menu "$SCRIPT_NAME" # Removal - apt purge clamav-daemon -y - apt purge clamav-freshclam -y - apt purge clamav -y + apt-get purge clamav-daemon -y + apt-get purge clamav-freshclam -y + apt-get purge clamav -y apt-get autoremove -y rm -f /etc/systemd/system/clamav-daemon.service rm -f "$SCRIPTS"/clamav-fullscan.sh diff --git a/apps/extract.sh b/apps/extract.sh index ee322ab4..2edacbf6 100644 --- a/apps/extract.sh +++ b/apps/extract.sh @@ -32,7 +32,7 @@ else do if is_this_installed "$packet" then - apt purge "$packet" -y + apt-get purge "$packet" -y fi done apt-get autoremove -y diff --git a/apps/fail2ban.sh b/apps/fail2ban.sh index 58fb6207..bcb7aaf6 100644 --- a/apps/fail2ban.sh +++ b/apps/fail2ban.sh @@ -38,7 +38,7 @@ else then print_text_in_color "$ICyan" "Unbanning all currently blocked IPs..." fail2ban-client unban --all - apt purge fail2ban -y + apt-get purge fail2ban -y rm -rf /etc/fail2ban crontab -u root -l | grep -v "$SCRIPTS/daily_fail2ban_report.sh" | crontab -u root - rm -rf "$SCRIPTS/daily_fail2ban_report.sh" diff --git a/apps/midnight-commander.sh b/apps/midnight-commander.sh index d51ef7d1..735c2b23 100644 --- a/apps/midnight-commander.sh +++ b/apps/midnight-commander.sh @@ -30,7 +30,7 @@ else # Ask for removal or reinstallation reinstall_remove_menu "$SCRIPT_NAME" # Removal - apt purge mc -y + apt-get purge mc -y apt-get autoremove -y # Show successful uninstall if applicable removal_popup "$SCRIPT_NAME" diff --git a/apps/previewgenerator.sh b/apps/previewgenerator.sh index 9d0720cc..8ee6a57c 100644 --- a/apps/previewgenerator.sh +++ b/apps/previewgenerator.sh @@ -53,12 +53,12 @@ else do if is_this_installed "$app" then - apt purge "$app" -y + apt-get purge "$app" -y fi done if is_this_installed ffmpeg && ! is_app_installed integration_whiteboard then - apt purge ffmpeg -y + apt-get purge ffmpeg -y fi apt-get autoremove -y if yesno_box_no "Do you want to remove all previews that were generated until now? diff --git a/apps/talk.sh b/apps/talk.sh index eb9f745b..aa47af56 100644 --- a/apps/talk.sh +++ b/apps/talk.sh @@ -57,7 +57,7 @@ else do if is_this_installed "$app" then - apt purge "$app" -y + apt-get purge "$app" -y fi done apt-get autoremove -y diff --git a/apps/whiteboard.sh b/apps/whiteboard.sh index 03de430e..3691ecdb 100644 --- a/apps/whiteboard.sh +++ b/apps/whiteboard.sh @@ -38,12 +38,12 @@ else do if is_this_installed "$packet" then - apt purge "$packet" -y + apt-get purge "$packet" -y fi done if is_this_installed ffmpeg && ! nextcloud_occ config:system:get enabledPreviewProviders | grep -q "Movie" then - apt purge ffmpeg -y + apt-get purge ffmpeg -y fi apt-get autoremove -y # Show successful uninstall if applicable diff --git a/disk/smart-monitoring.sh b/disk/smart-monitoring.sh index 64521364..531ec3de 100644 --- a/disk/smart-monitoring.sh +++ b/disk/smart-monitoring.sh @@ -29,7 +29,7 @@ else reinstall_remove_menu "$SCRIPT_NAME" # Removal rm -f "$SCRIPTS/smart-notification.sh" - check_command apt purge smartmontools -y + check_command apt-get purge smartmontools -y apt-get autoremove -y rm -f /etc/smartd.conf # reset the cronjob @@ -99,7 +99,7 @@ then msg_box "It seems like not even one drive supports smart monitoring. This is completely normal if you run this script in a VM since virtual drives don't support smart monitoring. We will uninstall smart monitoring now since you won't get any helpful notification out of this going forward." - apt purge smartmontools -y + apt-get purge smartmontools -y apt-get autoremove -y exit 1 fi diff --git a/network/ddclient-configuration.sh b/network/ddclient-configuration.sh index 23129119..4c38ee4f 100644 --- a/network/ddclient-configuration.sh +++ b/network/ddclient-configuration.sh @@ -30,10 +30,10 @@ else # Ask for removal or reinstallation reinstall_remove_menu "$SCRIPT_NAME" # Removal - apt purge ddclient -y + apt-get purge ddclient -y if is_this_installed libjson-any-perl then - apt purge libjson-any-perl -y + apt-get purge libjson-any-perl -y fi apt-get autoremove -y rm -f /etc/ddclient.conf diff --git a/network/geoblock.sh b/network/geoblock.sh index 60aaecb5..3cb7ee92 100644 --- a/network/geoblock.sh +++ b/network/geoblock.sh @@ -35,7 +35,7 @@ else if is_this_installed libapache2-mod-geoip then a2dismod geoip - apt purge libapache2-mod-geoip -y + apt-get purge libapache2-mod-geoip -y fi apt-get autoremove -y sed -i "/^#Geoip-block-start/,/^#Geoip-block-end/d" /etc/apache2/apache2.conf diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index 06153654..6a4660fd 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -218,7 +218,7 @@ stop_if_installed mariadb-server # We don't want automatic updates since they might fail (we use our own script) if is_this_installed unattended-upgrades then - apt purge unattended-upgrades -y + apt-get purge unattended-upgrades -y apt-get autoremove -y rm -rf /var/log/unattended-upgrades fi diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 3dba696b..0a490197 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -249,7 +249,7 @@ then fi fi -export DEBIAN_FRONTEND=noninteractive ; apt dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" +export DEBIAN_FRONTEND=noninteractive ; apt-get dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" # Update Netdata if [ -d /etc/netdata ] @@ -276,7 +276,7 @@ then if ! snap list certbot >/dev/null 2>&1 then print_text_in_color "$ICyan" "Reinstalling certbot (Let's Encrypt) as a snap instead..." - apt remove certbot -y + apt-get remove certbot -y apt-get autoremove -y install_if_not snapd snap install core diff --git a/not-supported/bitlocker-mount.sh b/not-supported/bitlocker-mount.sh index 75c2c0e2..48ebdae6 100644 --- a/not-supported/bitlocker-mount.sh +++ b/not-supported/bitlocker-mount.sh @@ -71,7 +71,7 @@ then msg_box "No drive found within 60 seconds. Please run this script again if you want to try again." msg_box "We will now remove dislocker so that you keep a clean system." - apt purge dislocker -y + apt-get purge dislocker -y apt-get autoremove -y exit fi @@ -88,7 +88,7 @@ If you want to cancel, type 'exit' and press [ENTER].") if [ "$PASSWORD" = "exit" ] then msg_box "We will now remove dislocker so that you keep a clean system." - apt purge dislocker -y + apt-get purge dislocker -y apt-get autoremove -y exit 1 fi @@ -119,7 +119,7 @@ If you want to cancel, type 'exit' and press [ENTER].") umount /media/bitlocker/1 sed -i '/fuse.dislocker/d' /etc/fstab msg_box "We will now remove dislocker so that you keep a clean system." - apt purge dislocker -y + apt-get purge dislocker -y apt-get autoremove -y exit 1 elif echo "$MOUNT_PATH" | grep -q " " diff --git a/not-supported/pi-hole.sh b/not-supported/pi-hole.sh index 6a04cb16..8daa442e 100644 --- a/not-supported/pi-hole.sh +++ b/not-supported/pi-hole.sh @@ -118,13 +118,13 @@ Please report this to $ISSUES" # Remove all initially installed applications for program in "${INSTALLED[@]}" do - apt purge "$program" -y + apt-get purge "$program" -y done # Remove unbound if is_this_installed unbound then - apt purge unbound -y + apt-get purge unbound -y fi # Remove not needed dependencies diff --git a/not-supported/plexmediaserver.sh b/not-supported/plexmediaserver.sh index 3fa15154..c7cfa22d 100644 --- a/not-supported/plexmediaserver.sh +++ b/not-supported/plexmediaserver.sh @@ -26,7 +26,7 @@ then If you want to delete PLEX Media Server and it's data to be able \ to start from scratch, run the following two commands: -'sudo apt purge plexmediaserver' +'sudo apt-get purge plexmediaserver' 'sudo deluser plex' Attention! This will delete the user-data: diff --git a/not-supported/remotedesktop.sh b/not-supported/remotedesktop.sh index 95e3188a..4f192dc9 100644 --- a/not-supported/remotedesktop.sh +++ b/not-supported/remotedesktop.sh @@ -216,10 +216,10 @@ install_remove_packet() { if is_this_installed "$1" then print_text_in_color "$ICyan" "Uninstalling $2" - apt purge "$1" -y + apt-get purge "$1" -y if [ "$1" = "grsync" ] then - apt purge gnome-themes-extra -y + apt-get purge gnome-themes-extra -y fi apt-get autoremove -y if [ "$1" = "nautilus" ] @@ -267,7 +267,7 @@ picard sound-juicer vlc acpid gnome-shell-extension-dash-to-panel gnome-shell-ex do if is_this_installed "$app" then - apt purge "$app" -y + apt-get purge "$app" -y fi done apt-get autoremove -y @@ -301,8 +301,8 @@ picard sound-juicer vlc acpid gnome-shell-extension-dash-to-panel gnome-shell-ex if is_this_installed makemkv-oss || is_this_installed makemkv-bin then print_text_in_color "$ICyan" "Uninstalling $SUBTITLE" - apt purge makemkv-oss -y - apt purge makemkv-bin -y + apt-get purge makemkv-oss -y + apt-get purge makemkv-bin -y apt-get autoremove -y add-apt-repository --remove ppa:heyarje/makemkv-beta -y apt-get update -q4 & spinner_loading @@ -333,7 +333,7 @@ We will need to add a 3rd party repository to install it which can set your serv if is_this_installed onlyoffice-desktopeditors then print_text_in_color "$ICyan" "Uninstalling $SUBTITLE" - apt purge onlyoffice-desktopeditors -y + apt-get purge onlyoffice-desktopeditors -y apt-get autoremove -y rm -f /etc/apt/sources.list.d/onlyoffice-desktopeditors.list apt-get update -q4 & spinner_loading diff --git a/not-supported/tpm2-unlock.sh b/not-supported/tpm2-unlock.sh index a374d336..f18d8d7f 100644 --- a/not-supported/tpm2-unlock.sh +++ b/not-supported/tpm2-unlock.sh @@ -80,7 +80,7 @@ if ! echo "$PASSWORD" | clevis luks bind -k - -d "/dev/${ENCRYPTED_DEVICE[*]}" t then msg_box "Something has failed while trying to configure clevis luks. We will now uninstall all needed packets again, so that you are able to start over." - apt purge clevis-tpm2 clevis-luks clevis-initramfs -y + apt-get purge clevis-tpm2 clevis-luks clevis-initramfs -y apt-get autoremove -y msg_box "All installed packets were successfully removed." exit 1 diff --git a/static/docker_overlay2.sh b/static/docker_overlay2.sh index 25f1cde2..e8ff4c51 100644 --- a/static/docker_overlay2.sh +++ b/static/docker_overlay2.sh @@ -149,7 +149,7 @@ rm -Rf /var/cache/apt/archives/aufs* # Upgrade docker to latest version rm -Rf /var/lib/docker apt-get update -q4 & spinner_loading -apt upgrade docker-ce -y +apt-get upgrade docker-ce -y # Load docker images back print_text_in_color "$ICyan" "Importing saved docker images to overlay2..."