Created
December 27, 2018 16:24
-
-
Save miigotu/69d101bab29642692f5890211a1e3ef5 to your computer and use it in GitHub Desktop.
apt update && apt upgrade --autoremove --purge with one command
This file contains 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
# Quick script by miigotu, place in ~/bin or other location in your path | |
#!/bin/bash -- | |
out=`sudo apt-get update 2>&1 | tee /dev/tty` | |
status=${out##*$'\n'} | |
if [ "${out##*$'\n'}" != "All packages are up to date." ]; then | |
sudo apt-get upgrade --autoremove --purge | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment