One line Debian/Ubuntu upgrade and clean up

The following command:

  • gets the latest update information
  • upgrades all packages (without prompting for confirmation)
  • removes any unneeded install files
  • removes any unnedded packages
  • checks if any services or daemons need to be restarted

Note: the debian-goodies package needs to be installed to use the checkrestart command

apt-get update;apt-get upgrade -y;apt-get autoclean;apt-get autoremove;checkrestart

Linux allows running applications to be updated however they will not start to use the new files until restarted. The checkrestart command (from the Debian package description):

Help to find and restart processes which are using old versions of upgraded files (such as libraries)

One line Debian/Ubuntu upgrade and clean up