How to get the list of files to be upgraded in Ubuntu

If you ever use or Ubuntu server (or Ubuntu desktop) you may come across this message when you first login:

Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-36-generic x86_64)

 * Documentation:

  System information as of Tue Feb 24 09:11:17 EST 2015

  System load:  0.07               Processes:           127
  Usage of /:   12.1% of 37.04GB   Users logged in:     0
  Memory usage: 14%                IP address for eth0:
  Swap usage:   0%

  Graph this data and manage this system at:

168 packages can be updated.
104 updates are security updates.

Last login: Tue Feb 24 09:11:22 2015 from ..

What I normally do is running sudo apt-get update but this is not the right command to use. The command I should be using is sudo apt-get upgrade

A little bit of Googling, I found that I can list all of the packages that are available for upgrade using the following:

sudo apt-get upgrade --dry-run

Note that the --dry-run allow us to see list of files/packages that will be upgraded but no changes will be made.

Running the above command will give you something like the following outputs:

$sudo apt-get upgrade --dry-run
[sudo] password for jack_the_admin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libsqlite0 pgdg-keyring
Use 'apt-get autoremove' to remove them.
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
The following packages will be upgraded:
  apparmor apport apt apt-transport-https apt-utils base-files bash bind9-host
  binutils bsdutils ca-certificates comerr-dev coreutils cpio dbus dbus-x11
  dh-apparmor dnsutils e2fslibs e2fsprogs exuberant-ctags file
  gir1.2-pango-1.0 krb5-locales krb5-multidev landscape-common
  language-pack-en language-selector-common libapparmor-perl libapparmor1
  libapt-inst1.5 libapt-pkg4.12 libbind9-90 libblkid1 libc-bin libc-dev-bin
  libc6 libc6-dev libcairo-gobject2 libcairo-script-interpreter2 libcairo2
  libcairo2-dev libcgmanager0 libcomerr2 libcurl3-gnutls libdbus-1-3
  libdbus-1-dev libdns100 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2
  python-software-properties python-urllib3 python3-apport python3-apt
  python3-distupgrade python3-problem-report rsyslog systemd-services tcpdump
  tzdata ubuntu-release-upgrader-core udev unzip update-notifier-common
  util-linux uuid-runtime wget wpasupplicant x11-common x11proto-core-dev
161 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Inst base-files [7.2ubuntu5.1] (7.2ubuntu5.2 Ubuntu:14.04/trusty-updates [amd64])
Conf base-files (7.2ubuntu5.2 Ubuntu:14.04/trusty-updates [amd64])
Inst bash [4.3-7ubuntu1.4] (4.3-7ubuntu1.5 Ubuntu:14.04/trusty-updates [amd64])
Conf bash (4.3-7ubuntu1.5 Ubuntu:14.04/trusty-updates [amd64])
Conf mount (2.20.1-5.1ubuntu20.4 Ubuntu:14.04/trusty-updates [am

With this information you can decide if you want to proceed with actual upgrade.

Happy Hacking.

Useful Links

comments powered by Disqus