Commit 1e8fc237 authored by Ilja's avatar Ilja
Browse files

autoremove uses --purge now

parent ba65f935
#!/bin/bash
# This script updates the system and sends a notification when updates start and stops.
# Note that notifications wont work when using cron, only if the script is started in the desktop itself.
# Note that notifications wont work when using cron, only if the script is started in the DE itself.
# Each message is also kept in a logfile.
################################################################
# General SETTINGS
################################################################
LOGLINES_TO_KEEP=30
LOGLINES_TO_KEEP=100
MY_PASSWORD_DIALOG_FOLDER="$HOME/.local/bin"
MY_PASSWORD_DIALOG_FILE="my-password-dialog"
LOGFILE_DIR="$HOME/.update-system/log"
LOGFILE_NAME="update-system.log"
EXCLUDE_IF_RUNNING="firefox"
EXCLUDE_IF_RUNNING="firefox" # This is a space-seperated list
################################################################
# FUNCTIONS
......@@ -78,7 +78,7 @@ else
! [ -z "$RUNNING" ] && sudo -A apt-mark hold $RUNNING && log_info "Won't be upgraded becasue they are active: $RUNNING"
sudo -A apt-get upgrade -y
sudo -A apt autoremove -y
sudo -A apt autoremove -y --purge
! [ -z "$RUNNING" ] && sudo -A apt-mark unhold $RUNNING
! [ -z "$HOLDING" ] && sudo -A apt-mark hold $HOLDING
......@@ -86,6 +86,14 @@ else
log_info "Updating finished!"
fi
##
# We have to do snaps too now :( I should integrate this a bit more
# `snap refresh --list` gives updatable packages. Not 100% sure how it lists them so can't really use it yet.
##
log_info "Updating snap packages..."
sudo -A snap refresh
log_info "Done!"
##
# Clean up logfiles
##
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment