Ubuntu Linux server – Install updates via apt-get command line

The commands are as follows:

apt-get update : First, you use the update option to resynchronize the package index files from their sources on Ubuntu Linux via the Internet.

apt-get upgrade : Second, you use the upgrade option to install the newest versions of all packages currently installed on the Ubuntu system. In other words, get security updates for your machine.

sudo apt-get install package-name : Install is followed by one or more packages desired for installation. If package is already installed it will try to update to latest version.

First, open the Terminal application and type following two commands (Application > Accessories > Terminal and then type the commands as the root user). However, one can quickly open the terminal app. Hence, press Ctrl+Alt+T.

Get updated software list for Ubuntu, enter:

Type the following apt-get command:

$sudo apt-get update

Or

$sudo apt update

To see available updates, run:

$apt list --upgradable

Update software(s) i.e. apply updates and patches on Ubuntu Linux

Type the following apt-get command:

$sudo apt-get upgrade

Or

$sudo apt upgrade

Please note that above two commands will fetch files from the Internets or local mirrors. The location of update pages is specified in /etc/apt/sources.list (repositories). You need NOT to make any changes to this file until and unless you need extra repositories for your setup.

Install kernel updates on a Ubuntu LTS server

Type the following apt-get command:

$sudo apt-get dist-upgrade

If a new kernel installed, reboot the Linux server:

$sudo reboot

In conclusion, keeping your system kernel and apps is an essential task for all developers and sysadmin. A patched system prevents security issues and increases system stability.