How to update list of available packages on Ubuntu server

Commands to update Ubuntu package list

1. Log into your Ubuntu server


To update the list of available packages, you must log into your Ubuntu server as user with sudo privileges or as root user.

You can SSH into your Ubuntu server using softwares like ‘Putty’


2. Run ‘apt update’ to update the package list from the repository

Note : apt update command will not install the latest version of the software.


Command :

apt update


apt-get update

Example :

# apt update
Get:1 bionic-security InRelease [88.7 kB]
Get:2 bionic InRelease [242 kB]
Get:3 bionic-security/universe amd64 Packages [794 kB]
Get:4 bionic-updates InRelease [88.7 kB]
Get:5 bionic-backports InRelease [74.6 kB]
Get:6 bionic/restricted amd64 Packages [13.5 kB]
Get:7 bionic/main amd64 Packages [1344 kB]
Get:8 bionic/multiverse amd64 Packages [186 kB]
Get:9 bionic/universe amd64 Packages [11.3 MB]
Get:10 bionic-security/main amd64 Packages [760 kB]
Get:11 bionic-security/restricted amd64 Packages [19.2 kB]
Get:12 bionic-security/multiverse amd64 Packages [6783 B]
Get:13 bionic-updates/main amd64 Packages [1056 kB]
Get:14 bionic-updates/restricted amd64 Packages [32.7 kB]
Get:15 bionic-updates/multiverse amd64 Packages [10.5 kB]
Get:16 bionic-updates/universe amd64 Packages [1321 kB]
Get:17 bionic-backports/main amd64 Packages [2496 B]
Get:18 bionic-backports/universe amd64 Packages [4244 B]
Fetched 17.4 MB in 26s (670 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
37 packages can be upgraded. Run 'apt list --upgradable' to see them.


The above command shows upgrade is available for 37 packages installed on your ubuntu server.


Update software list using aptitude command


1. Log into Ubuntu server as user with sudo privilege or as ‘root’ user

2. Run ‘aptitude update’ command

aptitude update command will download lists of new/upgradable packages.


# aptitude update
Hit bionic InRelease
Get: 1 bionic-updates InRelease [88.7 kB]
Get: 2 bionic-security InRelease [88.7 kB]
Get: 3 bionic-backports InRelease [74.6 kB]
Fetched 252 kB in 3s (99.3 kB/s)