Ubuntu was built to compete with Windows, and as such it includes a lot of features Windows users take for granted. Canonical packaged Ubuntu with the automated process for downloading and installing security and performance updates over an Internet connection, a procedure very similar to Windows Update in Microsoft Windows versions. As an aside, the amount of effort to build this service and the content delivery network (CDN) to distribute the updates is fairly impressive.
While Ubuntu Desktop gives users the option to update the system via the GUI interface — that is generally not an option with Ubuntu Server, as most deployments will run it with command line interface (CLI) only, so included below is the description of the two commands necessary to kick off the Ubuntu update process.
To fetch the list of available updates for your system, enter the apt-get update command via the CLI. Running this command without root superuser privileges will produce a permission denied error.
Thus you must prefix it with the sudo command:
sudo apt-get update
You will be prompted to enter the password prior to getting the list of updates.
Run this command periodically to make sure your source list is up-to-date.
To download and install the applicable updates, enter the apt-get upgrade command via the CLI:
sudo apt-get upgrade
This command upgrades all installed packages.
If you look at the upgrade installation results closely, you may notice that 3 packages were not upgraded, but kept back.
According to Ubuntu manual: “Running apt-get dist-upgrade adds the “smart upgrade” checkbox. It tells APT to use “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. Please note apt-get dist-upgrade does not perform distribution upgrade.”
sudo apt-get dist-upgrade
As you may have noticed from the screenshot in the above example, the apt-get dist-upgrade command did upgrade the three Linux packages that were previously kept back.
While on this subject, here are a couple more package update related apt-get commands:
This command removes .deb files for packages that are no longer installed on your system. Depending on your installation habits, removing these files from /var/cache/apt/archives may regain a significant amount of diskspace.
The same as above, except it removes all packages from the package cache. This may not be desirable if you have a slow Internet connection, since it will cause you to redownload any packages you need to install a program. The command “du -sh /var/cache/apt/archives” will tell you how much space cached packages are consuming.
Also, these commands were ran in Ubuntu Server 14.04, but the apt-get commands are the same and have not changed going back quite a few versions of Ubuntu.