Learn how to get a list of all the installed packages on your ubuntu server with the CLI.

How to list all the packages installed on Ubuntu 16.04

In production environment, you will need a lot of components installed on your server to guarantee that your apps works correctly. Pitifully, running the install command of some component when the component is already installed may lead to a misconfiguration of the component, so your app may not work as expected.

The simplest solution is to know which packages are installed on the system before installing or even upgrading. This can be simply done in Ubuntu 16.04 with the following command:

apt list --installed

This will generate a verbose output with a list of the installed packages on the terminal:

Listing... Done
accountsservice/xenial-updates,now 0.6.40-2ubuntu11.3 amd64 [installed]
acl/xenial,now 2.2.52-3 amd64 [installed]
acpid/xenial,now 1:2.0.26-1ubuntu2 amd64 [installed]
adduser/xenial,xenial,now 3.113+nmu3ubuntu4 all [installed]
ansible/xenial,xenial,now 2.6.0-1ppa~xenial all [installed]
ant/xenial,xenial,now 1.9.6-1ubuntu1 all [installed]
ant-optional/xenial,xenial,now 1.9.6-1ubuntu1 all [installed,automatic]
apache2/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.8 amd64 [installed,automatic]
apache2-bin/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.8 amd64 [installed,automatic]
apache2-data/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.4.18-2ubuntu3.8 all [installed,automatic]
apache2-utils/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.8 amd64 [installed,automatic]
apparmor/xenial-updates,now 2.10.95-0ubuntu2.9 amd64 [installed]
apport/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.20.1-0ubuntu2.18 all [installed]
apport-symptoms/xenial,xenial,now 0.20 all [installed]
apt/xenial-updates,now 1.2.26 amd64 [installed]
apt-transport-https/xenial-updates,now 1.2.26 amd64 [installed]
apt-utils/xenial-updates,now 1.2.26 amd64 [installed]
aptitude/xenial,now 0.7.4-2ubuntu2 amd64 [installed]
aptitude-common/xenial,xenial,now 0.7.4-2ubuntu2 all [installed,automatic]
at/xenial,now 3.1.18-2ubuntu1 amd64 [installed]
base-files/xenial-updates,now 9.4ubuntu4.6 amd64 [installed]
base-passwd/xenial,now 3.5.39 amd64 [installed]
bash/xenial-updates,xenial-security,now 4.3-14ubuntu1.2 amd64 [installed]
bash-completion/xenial-updates,xenial-updates,now 1:2.1-4.2ubuntu1.1 all [installed]
bcache-tools/xenial,now 1.0.8-2 amd64 [installed]
bind9-host/xenial-updates,xenial-security,now 1:9.10.3.dfsg.P4-8ubuntu1.10 amd64 [installed]
binutils/xenial-updates,xenial-security,now 2.26.1-1ubuntu1~16.04.6 amd64 [installed,automatic]
bsdmainutils/xenial,now 9.0.6ubuntu3 amd64 [installed]
bsdutils/xenial-updates,now 1:2.27.1-6ubuntu3.4 amd64 [installed]
btrfs-tools/xenial-updates,now 4.4-1ubuntu1 amd64 [installed]
build-essential/xenial,now 12.1ubuntu2 amd64 [installed,automatic]
busybox-initramfs/xenial,now 1:1.22.0-15ubuntu1 amd64 [installed]
busybox-static/xenial,now 1:1.22.0-15ubuntu1 amd64 [installed]
byobu/xenial,xenial,now 5.106-0ubuntu1 all [installed]
bzip2/xenial,now 1.0.6-8 amd64 [installed]
ca-certificates/xenial-updates,xenial-updates,xenial-security,xenial-security,now 20170717~16.04.1 all [installed]
ca-certificates-java/xenial-updates,xenial-updates,now 20160321ubuntu1 all [installed,automatic]
cloud-guest-utils/xenial-updates,xenial-updates,now 0.27-0ubuntu25.1 all [installed]
cloud-initramfs-copymods/xenial-updates,xenial-updates,now 0.27ubuntu1.5 all [installed]
cloud-initramfs-dyn-netconf/xenial-updates,xenial-updates,now 0.27ubuntu1.5 all [installed]
console-setup/xenial-updates,xenial-updates,now 1.108ubuntu15.4 all [installed]
console-setup-linux/xenial-updates,xenial-updates,now 1.108ubuntu15.4 all [installed]
coreutils/xenial-updates,now 8.25-2ubuntu3~16.04 amd64 [installed]
cpio/xenial,now 2.11+dfsg-5ubuntu1 amd64 [installed]
cpp/xenial,now 4:5.3.1-1ubuntu1 amd64 [installed,automatic]
cpp-5/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed,automatic]
crda/xenial,now 3.13-1 amd64 [installed,automatic]
cron/xenial,now 3.0pl1-128ubuntu2 amd64 [installed]
cryptsetup/xenial-updates,now 2:1.6.6-5ubuntu2.1 amd64 [installed]
cryptsetup-bin/xenial-updates,now 2:1.6.6-5ubuntu2.1 amd64 [installed]
curl/xenial-updates,xenial-security,now 7.47.0-1ubuntu2.8 amd64 [installed]
dash/xenial,now 0.5.8-2.1ubuntu2 amd64 [installed]
dbus/xenial-updates,now 1.10.6-1ubuntu3.3 amd64 [installed]
debconf/xenial,xenial,now 1.5.58ubuntu1 all [installed]
debconf-i18n/xenial,xenial,now 1.5.58ubuntu1 all [installed]
debianutils/xenial,now 4.7 amd64 [installed]
default-jre-headless/xenial,now 2:1.8-56ubuntu2 amd64 [installed,automatic]
dh-python/xenial-updates,xenial-updates,now 2.20151103ubuntu1.1 all [installed]
diffutils/xenial,now 1:3.3-3 amd64 [installed]
distro-info-data/xenial-updates,xenial-updates,xenial-security,xenial-security,now 0.28ubuntu0.8 all [installed]
dkms/xenial-updates,xenial-updates,now 2.2.0.3-2ubuntu11.5 all [installed]
dmeventd/xenial,now 2:1.02.110-1ubuntu10 amd64 [installed]
dmidecode/xenial-updates,now 3.0-2ubuntu0.1 amd64 [installed]
dmsetup/xenial,now 2:1.02.110-1ubuntu10 amd64 [installed]
dns-root-data/xenial,xenial,now 2015052300+h+1 all [installed]
dnsmasq-base/xenial-updates,now 2.75-1ubuntu0.16.04.4 amd64 [installed]
dnsutils/xenial-updates,xenial-security,now 1:9.10.3.dfsg.P4-8ubuntu1.10 amd64 [installed]
dosfstools/xenial-updates,xenial-security,now 3.0.28-2ubuntu0.1 amd64 [installed]
dpkg/xenial-updates,now 1.18.4ubuntu1.4 amd64 [installed]
dpkg-dev/xenial-updates,xenial-updates,now 1.18.4ubuntu1.4 all [installed,automatic]
e2fslibs/xenial,now 1.42.13-1ubuntu1 amd64 [installed]
e2fsprogs/xenial,now 1.42.13-1ubuntu1 amd64 [installed]
ed/xenial,now 1.10-2 amd64 [installed]
eject/xenial-updates,xenial-security,now 2.1.5+deb1+cvs20081104-13.1ubuntu0.16.04.1 amd64 [installed]
ethtool/xenial,now 1:4.5-1 amd64 [installed]
fakeroot/xenial,now 1.20.2-1ubuntu1 amd64 [installed,automatic]
file/xenial-updates,xenial-security,now 1:5.25-2ubuntu1.1 amd64 [installed]
findutils/xenial,now 4.6.0+git+20160126-2 amd64 [installed]
fontconfig-config/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.11.94-0ubuntu1.1 all [installed,automatic]
fonts-dejavu-core/xenial,xenial,now 2.35-1 all [installed,automatic]
ftp/xenial,now 0.17-33 amd64 [installed]
fuse/xenial-updates,now 2.9.4-1ubuntu3.1 amd64 [installed]
g++/xenial,now 4:5.3.1-1ubuntu1 amd64 [installed,automatic]
g++-5/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed,automatic]
gawk/xenial,now 1:4.1.3+dfsg-0.1 amd64 [installed]
gcc/xenial,now 4:5.3.1-1ubuntu1 amd64 [installed,automatic]
gcc-5/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed,automatic]
gcc-5-base/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed]
gcc-6-base/xenial,now 6.0.1-0ubuntu1 amd64 [installed]
geoip-database/xenial,xenial,now 20160408-1 all [installed]
gettext-base/xenial,now 0.19.7-2ubuntu3 amd64 [installed]
gir1.2-glib-2.0/xenial,now 1.46.0-3ubuntu1 amd64 [installed,automatic]
git/xenial-updates,xenial-security,now 1:2.7.4-0ubuntu1.4 amd64 [installed]
git-man/xenial-updates,xenial-updates,xenial-security,xenial-security,now 1:2.7.4-0ubuntu1.4 all [installed]
gnupg/xenial-updates,xenial-security,now 1.4.20-1ubuntu3.2 amd64 [installed]
gpgv/xenial-updates,xenial-security,now 1.4.20-1ubuntu3.2 amd64 [installed]
grep/xenial-updates,now 2.25-1~16.04.1 amd64 [installed]
groff-base/xenial,now 1.22.3-7 amd64 [installed]
grub-common/xenial-updates,now 2.02~beta2-36ubuntu3.18 amd64 [installed]
grub-gfxpayload-lists/xenial,now 0.7 amd64 [installed,automatic]
grub-legacy-ec2/xenial-updates,xenial-updates,now 18.2-4-g05926e48-0ubuntu1~16.04.2 all [installed]
grub-pc/xenial-updates,now 2.02~beta2-36ubuntu3.18 amd64 [installed]
grub-pc-bin/xenial-updates,now 2.02~beta2-36ubuntu3.18 amd64 [installed,automatic]
grub2-common/xenial-updates,now 2.02~beta2-36ubuntu3.18 amd64 [installed,automatic]
gyp/xenial,xenial,now 0.1+20150913git1f374df9-1ubuntu1 all [installed,automatic]
gzip/xenial,now 1.6-4ubuntu1 amd64 [installed]
hdparm/xenial-updates,now 9.48+ds-1ubuntu0.1 amd64 [installed]
hostname/xenial,now 3.16ubuntu2 amd64 [installed]
htop/xenial-updates,now 2.0.1-1ubuntu1 amd64 [installed]
ifenslave/xenial,xenial,now 2.7ubuntu1 all [installed]
ifupdown/xenial-updates,now 0.8.10ubuntu1.4 amd64 [installed]
info/xenial,now 6.1.0.dfsg.1-5 amd64 [installed]
init/xenial-updates,now 1.29ubuntu4 amd64 [installed]
init-system-helpers/xenial-updates,xenial-updates,now 1.29ubuntu4 all [installed]
initramfs-tools/xenial-updates,xenial-updates,now 0.122ubuntu8.11 all [installed]
initramfs-tools-bin/xenial-updates,now 0.122ubuntu8.11 amd64 [installed]
initramfs-tools-core/xenial-updates,xenial-updates,now 0.122ubuntu8.11 all [installed]
initscripts/xenial,now 2.88dsf-59.3ubuntu2 amd64 [installed]
insserv/xenial,now 1.14.0-5ubuntu3 amd64 [installed]
install-info/xenial,now 6.1.0.dfsg.1-5 amd64 [installed]
iproute2/xenial-updates,now 4.3.0-1ubuntu3.16.04.3 amd64 [installed]
iptables/xenial,now 1.6.0-2ubuntu3 amd64 [installed]
iputils-ping/xenial,now 3:20121221-5ubuntu2 amd64 [installed]
iputils-tracepath/xenial,now 3:20121221-5ubuntu2 amd64 [installed]
irqbalance/xenial,now 1.1.0-2ubuntu1 amd64 [installed]
isc-dhcp-client/xenial-updates,now 4.3.3-5ubuntu12.10 amd64 [installed]
isc-dhcp-common/xenial-updates,now 4.3.3-5ubuntu12.10 amd64 [installed]
iso-codes/xenial,xenial,now 3.65-1 all [installed,automatic]
iw/xenial,now 3.17-1 amd64 [installed,automatic]
java-common/xenial,xenial,now 0.56ubuntu2 all [installed,automatic]
javascript-common/xenial,xenial,now 11 all [installed,automatic]
kbd/xenial-updates,now 1.15.5-1ubuntu5 amd64 [installed]
keyboard-configuration/xenial-updates,xenial-updates,now 1.108ubuntu15.4 all [installed]
keyutils/xenial,now 1.5.9-8ubuntu1 amd64 [installed,automatic]
klibc-utils/xenial-updates,now 2.0.4-8ubuntu1.16.04.4 amd64 [installed]
kmod/xenial-updates,xenial-security,now 22-1ubuntu5 amd64 [installed]
krb5-locales/xenial-updates,xenial-updates,now 1.13.2+dfsg-5ubuntu2 all [installed]
language-pack-en/xenial-updates,xenial-updates,now 1:16.04+20161009 all [installed]
language-pack-en-base/xenial-updates,xenial-updates,now 1:16.04+20160627 all [installed,automatic]
language-pack-gnome-en/xenial-updates,xenial-updates,now 1:16.04+20161009 all [installed]
language-pack-gnome-en-base/xenial-updates,xenial-updates,now 1:16.04+20160627 all [installed,automatic]
language-selector-common/xenial-updates,xenial-updates,now 0.165.4 all [installed]
less/xenial-updates,now 481-2.1ubuntu0.2 amd64 [installed]
libaccountsservice0/xenial-updates,now 0.6.40-2ubuntu11.3 amd64 [installed,automatic]
libacl1/xenial,now 2.2.52-3 amd64 [installed]
libaio1/xenial,now 0.3.110-2 amd64 [installed,automatic]
libalgorithm-diff-perl/xenial,xenial,now 1.19.03-1 all [installed,automatic]
libalgorithm-diff-xs-perl/xenial,now 0.04-4build1 amd64 [installed,automatic]
libalgorithm-merge-perl/xenial,xenial,now 0.08-3 all [installed,automatic]
libapache2-mod-php5.6/xenial,now 5.6.36-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
libapache2-mod-php7.0/xenial,now 7.0.30-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
libapache2-mod-php7.1/xenial,now 7.1.18-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
libapache2-mod-php7.2/xenial,now 7.2.7-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed]
libapparmor-perl/xenial-updates,now 2.10.95-0ubuntu2.9 amd64 [installed]
libapparmor1/xenial-updates,now 2.10.95-0ubuntu2.9 amd64 [installed]
libapr1/xenial,now 1.5.2-3 amd64 [installed,automatic]
libaprutil1/xenial,now 1.5.4-1build1 amd64 [installed,automatic]
libaprutil1-dbd-sqlite3/xenial,now 1.5.4-1build1 amd64 [installed,automatic]
libaprutil1-ldap/xenial,now 1.5.4-1build1 amd64 [installed,automatic]
libapt-inst2.0/xenial-updates,now 1.2.26 amd64 [installed]
libapt-pkg5.0/xenial-updates,now 1.2.26 amd64 [installed]
libargon2-0/xenial,now 0~20161029-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
libasan2/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed,automatic]
libasn1-8-heimdal/xenial-updates,xenial-security,now 1.7~git20150920+dfsg-4ubuntu1.16.04.1 amd64 [installed,automatic]
libasprintf0v5/xenial,now 0.19.7-2ubuntu3 amd64 [installed,automatic]
libatm1/xenial,now 1:2.5.1-1.5 amd64 [installed]
libatomic1/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed,automatic]
libattr1/xenial,now 1:2.4.47-2 amd64 [installed]
libaudit-common/xenial-updates,xenial-updates,now 1:2.4.5-1ubuntu2.1 all [installed]
libaudit1/xenial-updates,now 1:2.4.5-1ubuntu2.1 amd64 [installed]
libavahi-client3/xenial-updates,now 0.6.32~rc+dfsg-1ubuntu2.2 amd64 [installed,automatic]
libavahi-common-data/xenial-updates,now 0.6.32~rc+dfsg-1ubuntu2.2 amd64 [installed,automatic]
libavahi-common3/xenial-updates,now 0.6.32~rc+dfsg-1ubuntu2.2 amd64 [installed,automatic]
libbind9-140/xenial-updates,xenial-security,now 1:9.10.3.dfsg.P4-8ubuntu1.10 amd64 [installed,automatic]
libblkid1/xenial-updates,now 2.27.1-6ubuntu3.4 amd64 [installed]
libboost-iostreams1.58.0/xenial-updates,now 1.58.0+dfsg-5ubuntu3.1 amd64 [installed,automatic]
libbsd0/xenial,now 0.8.2-1 amd64 [installed]
libbz2-1.0/xenial,now 1.0.6-8 amd64 [installed]
libc-bin/xenial-updates,xenial-security,now 2.23-0ubuntu10 amd64 [installed]
libc-dev-bin/xenial-updates,xenial-security,now 2.23-0ubuntu10 amd64 [installed,automatic]
libc6/xenial-updates,xenial-security,now 2.23-0ubuntu10 amd64 [installed]
libc6-dev/xenial-updates,xenial-security,now 2.23-0ubuntu10 amd64 [installed,automatic]
libcap-ng0/xenial,now 0.7.7-1 amd64 [installed,automatic]
libcap2/xenial,now 1:2.24-12 amd64 [installed]
libcap2-bin/xenial,now 1:2.24-12 amd64 [installed]
libcc1-0/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed,automatic]
libcgi-fast-perl/xenial,xenial,now 1:2.10-1 all [installed,automatic]
libcgi-pm-perl/xenial,xenial,now 4.26-1 all [installed,automatic]
libcilkrts5/xenial-updates,xenial-security,now 5.4.0-6ubuntu1~16.04.10 amd64 [installed,automatic]
libclass-accessor-perl/xenial,xenial,now 0.34-1 all [installed,automatic]
libcomerr2/xenial,now 1.42.13-1ubuntu1 amd64 [installed]
libcryptsetup4/xenial-updates,now 2:1.6.6-5ubuntu2.1 amd64 [installed]
libcups2/xenial-updates,xenial-security,now 2.1.3-4ubuntu0.4 amd64 [installed,automatic]
libcurl3/xenial-updates,xenial-security,now 7.47.0-1ubuntu2.8 amd64 [installed,automatic]
libcurl3-gnutls/xenial-updates,xenial-security,now 7.47.0-1ubuntu2.8 amd64 [installed,automatic]
libcwidget3v5/xenial,now 0.5.17-4ubuntu2 amd64 [installed,automatic]
libdb5.3/xenial-updates,xenial-security,now 5.3.28-11ubuntu0.1 amd64 [installed]
libdbus-1-3/xenial-updates,now 1.10.6-1ubuntu3.3 amd64 [installed,automatic]
libdbus-glib-1-2/xenial,now 0.106-1 amd64 [installed,automatic]
libdebconfclient0/xenial,now 0.198ubuntu1 amd64 [installed]
libdevmapper-event1.02.1/xenial,now 2:1.02.110-1ubuntu10 amd64 [installed]
libdevmapper1.02.1/xenial,now 2:1.02.110-1ubuntu10 amd64 [installed]
libdns-export162/xenial-updates,xenial-security,now 1:9.10.3.dfsg.P4-8ubuntu1.10 amd64 [installed]
libdns162/xenial-updates,xenial-security,now 1:9.10.3.dfsg.P4-8ubuntu1.10 amd64 [installed,automatic]
libdpkg-perl/xenial-updates,xenial-updates,now 1.18.4ubuntu1.4 all [installed,automatic]
libdrm-common/xenial-updates,xenial-updates,now 2.4.83-1~16.04.1 all [installed,automatic]
libdrm2/xenial-updates,now 2.4.83-1~16.04.1 amd64 [installed,automatic]
libdumbnet1/xenial,now 1.12-7 amd64 [installed]
libedit2/xenial,now 3.1-20150325-1ubuntu2 amd64 [installed,automatic]
libelf1/xenial-updates,xenial-security,now 0.165-3ubuntu1.1 amd64 [installed,automatic]
libencode-locale-perl/xenial,xenial,now 1.05-1 all [installed,automatic]
liberror-perl/xenial,xenial,now 0.17-1.2 all [installed]
libestr0/xenial,now 0.1.10-1 amd64 [installed]
libevent-2.0-5/xenial-updates,xenial-security,now 2.0.21-stable-2ubuntu0.16.04.1 amd64 [installed]
libevent-core-2.0-5/xenial-updates,xenial-security,now 2.0.21-stable-2ubuntu0.16.04.1 amd64 [installed,automatic]
libexpat1/xenial-updates,xenial-security,now 2.1.0-7ubuntu0.16.04.3 amd64 [installed]
libfakeroot/xenial,now 1.20.2-1ubuntu1 amd64 [installed,automatic]
libfcgi-perl/xenial,now 0.77-1build1 amd64 [installed,automatic]
libfdisk1/xenial-updates,now 2.27.1-6ubuntu3.4 amd64 [installed]
libffi6/xenial,now 3.2.1-4 amd64 [installed]

According to this output you will be able to install or upgrade what you need without misconfiguring anything.

Happy coding !


Senior Software Engineer at Software Medico. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Sponsors