Hey readers!

Are you looking to see what exactly will be upgraded when you run apt-get upgrade, refresh your memory on what version is currently installed, and see what version will be installed? Well, I have a one-liner for YOU!

apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "PROGRAM: $1 INSTALLED: $2 AVAILABLE: $3\n"}' | column -s " " -t

and it outputs similar to the below snippet:

PROGRAM:  libapt-pkg4.12          INSTALLED:  1.0.1ubuntu2.13      AVAILABLE:  1.0.1ubuntu2.14
PROGRAM:  apt                     INSTALLED:  1.0.1ubuntu2.13      AVAILABLE:  1.0.1ubuntu2.14
PROGRAM:  libapt-inst1.5          INSTALLED:  1.0.1ubuntu2.13      AVAILABLE:  1.0.1ubuntu2.14
PROGRAM:  bash-completion         INSTALLED:  1:2.1-4ubuntu0.1     AVAILABLE:  1:2.1-4ubuntu0.2

This has been VERY good for keeping track of my servers, and I hope it helps some of you!

Next Post Previous Post