Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ilja
simple-kubuntu-upgrade-script
Commits
1e8fc237
Commit
1e8fc237
authored
Jul 17, 2021
by
Ilja
Browse files
autoremove uses --purge now
parent
ba65f935
Changes
1
Hide whitespace changes
Inline
Side-by-side
update-system.sh
View file @
1e8fc237
#!/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
=
3
0
LOGLINES_TO_KEEP
=
10
0
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
##
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment