Jet outro on-liner,
inspirado por esta resposta :
function a { read input;dpkg -l ${input} | grep " ${input} " | awk '{$1=$2=$3=$4="";print $0}' | sed 's/^ *//';unset input;};{ apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "$1 (\e[1;34m$2\e[0m -> \e[1;32m$3\e[0m)\n"}';} | while read -r line; do echo -en "$line $(echo $line | awk '{print $1}' | a )\n"; done;
A saída é assim (colorida):
locales (2.13-38+deb7u7 -> 2.13-38+deb7u8) Embedded GNU C Library: National Language (locale) data [support]
linux-headers-3.2.0-4-amd64 (3.2.65-1+deb7u1 -> 3.2.65-1+deb7u2) Header files for Linux 3.2.0-4-amd64
linux-headers-3.2.0-4-common (3.2.65-1+deb7u1 -> 3.2.65-1+deb7u2) Common header files for Linux 3.2.0-4
sudo (1.8.5p2-1+nmu1 -> 1.8.5p2-1+nmu2) Provide limited super user privileges to specific users
Se você não quiser uma breve descrição, use esta:
{ apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "$1 (\e[1;34m$2\e[0m -> \e[1;32m$3\e[0m)\n"}';} | while read -r line; do echo -en "$line\n"; done;
Saída:
locales (2.13-38+deb7u7 -> 2.13-38+deb7u8)
linux-headers-3.2.0-4-amd64 (3.2.65-1+deb7u1 -> 3.2.65-1+deb7u2)
linux-headers-3.2.0-4-common (3.2.65-1+deb7u1 -> 3.2.65-1+deb7u2)
sudo (1.8.5p2-1+nmu1 -> 1.8.5p2-1+nmu2)