Skip to content

Instantly share code, notes, and snippets.

@miigotu
Created December 27, 2018 16:24
Show Gist options
  • Save miigotu/69d101bab29642692f5890211a1e3ef5 to your computer and use it in GitHub Desktop.
Save miigotu/69d101bab29642692f5890211a1e3ef5 to your computer and use it in GitHub Desktop.
apt update && apt upgrade --autoremove --purge with one command
# 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