Created
August 20, 2020 01:27
-
-
Save bitaxis/b3f021fcdf73de701c1c1696f2ffdd64 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo '-----> update <-----' | |
apt update | |
echo '-----> upgrade <-----' | |
apt --yes upgrade | |
echo '-----> dist-upgrade <-----' | |
apt --yes dist-upgrade | |
echo '-----> autoremove <-----' | |
apt --yes autoremove | |
echo '-----> autoclean <-----' | |
apt autoclean | |
# dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt -y purge | |
# http://chr4.org/blog/2013/08/04/apt-cleanup-commands/ | |
echo '-----> purge <-----' | |
apt --yes purge $(dpkg --list |egrep 'linux-image-[0-9]' |awk '{print $3,$2}' |sort -nr |tail -n +2 |grep -v $(uname -r) |awk '{ print $2}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment