Introduction: Ubuntu Linux is an open source operating system based upon the Linux kernel and GNU command line utilities. Ubuntu Linux is extremely popular among new Linux users as well as developers all around the globe. This page shows how to list all installed packages with apt command or apt-get command on Ubuntu Linux.
You need to use the apt or apt-get or dpkg command to list all installed packages on an Ubuntu Linux server from the bash shell prompt.
How do I see what packages are installed on Ubuntu Linux?
The procedure to list what packages are installed on Ubuntu:
- Open the terminal application or log in to the remote server using ssh (e.g. ssh user@sever-name)
- Run command apt list --installed to list all installed packages on Ubuntu
- To display a list of packages satisfying certain criteria such as show matching apache2 packages, run apt list apache
Let us see some examples,.
apt list installed packages
Let us list all software packages on Ubuntu Linux available for us:
$ apt list
You might want to use the grep command/egrep command to filter out:
$ apt list | grep nginx
OR
$ apt list | more
However, you may see message on screen that read as follows:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
To avoid this message use the dpkg command as follows:
$ dpkg --list | grep nginx
$ dpkg --list | more
List all installed packages only
The apt command displays both installed and packages available to install. What if you want to list currently installed software only? Fear not, pass the option to the apt command:
$ apt list --installed
How to list or find out if a specific package installed or not
Run package policy as follows:
$ apt list -a pkgNameHere
Is sudo package installed?
$ apt list -a sudo
Is sudo package mariadb-server?
$ apt list -a mariadb-server
Ubuntu list installed packages
It is also possible to list installed packages matching given pattern. The syntax is:
dpkg -l pattern
dpkg --list pattern
apt list pattern
apt list --installed pattern
For example:
dpkg --list x*
Sample outputs:
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============================================-============================-============================-================================================================================================== ii xauth 1:1.0.10-1 amd64 X authentication utility ii xdelta3 3.0.11-dfsg-1ubuntu1 amd64 Diff utility which works with binary files ii xdg-user-dirs 0.17-1ubuntu1 amd64 tool to manage well known user directories un xflr5 <none> <none> (no description available) un xfsdump <none> <none> (no description available) ii xfsprogs 4.9.0+nmu1ubuntu2 amd64 Utilities for managing the XFS filesystem ii xkb-data 2.23.1-1ubuntu1 all X Keyboard Extension (XKB) configuration data un xloadimage <none> <none> (no description available) un xorriso <none> <none> (no description available) un xterm <none> <none> (no description available) un xvt <none> <none> (no description available) ii xxd 2:8.0.1453-1ubuntu1 amd64 tool to make (or reverse) a hex dump un xz-lzma <none> <none> (no description available) ii xz-utils 5.2.2-1.3 amd64 XZ-format compression utilities
Where,
- ii – Indicates that package named xauth installed.
- un – Indicates that package not installed or in Unknown status.
Conclusion
You learned how to list both installed and uninstalled packages on an Ubuntu Linux server or desktop using the CLI method.
- Ubuntu 18.04 update installed packages for security
- How Do I Update Ubuntu Linux Softwares Using Command Line?
- Ubuntu Linux: Upgrade Linux Kernel
- Ubuntu Enable & Setup Automatic Unattended Security Updates
- Linux: Update All Packages Command
- How do I update Ubuntu using terminal command line
- Debian upgrade or update a single package using apt-get
- Ubuntu upgrade or update a single package using apt-get
- How do I see what packages are installed on Ubuntu Linux?
- What does sudo apt-get update command do on Ubuntu/Debian?
- Ubuntu Linux – How Do I install .deb Packages?
- apt-get hold back packages on Ubuntu / Debian Linux
- Ubuntu 20.04 LTS update installed packages for security
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 1 comment... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Very informative article. Easy to understand for beginners.Thanks.