Skip to content

Instantly share code, notes, and snippets.

@truetone
Created September 15, 2014 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save truetone/14aed57c869d83df5037 to your computer and use it in GitHub Desktop.
Save truetone/14aed57c869d83df5037 to your computer and use it in GitHub Desktop.
Handy Linux (Ubuntu) Commands
# Show security updates only:
apt-get -s dist-upgrade |grep "^Inst" |grep -i securi
# Show all upgradeable packages
apt-get -s dist-upgrade | grep "^Inst"
# Install security updates only
apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install
# Check what services need to be restarted after package upgrades.
# Figure out what packages you are going to upgrade beforehand and schedule your restarts/reboots.
# The problem here is that unless you restart a service it still may be using an older version of
# a library (most common reason) that's been loaded into memory before you installed new package
# which fixes a security vulnerability or whatever.
checkrestart -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment