This post shows students and new users steps to list all installed packages on Ubuntu Linux. Knowing which packages are installed on Ubuntu Linux can be important especially when you’re looking for vulnerable packages or you’re building another machine and you want to install same packages on it.
There are multiple ways to view installed packages on Ubuntu Linux, and we’ll show you a few steps below that will list, count and show currently installed packages.
Although this post is written for Ubuntu Linux, it should also applied to other Debian based Linux distributions using the apt package management tool.
Also, for students and new users learning Linux, the easiest place to start learning is on Ubuntu Linux. Ubuntu is the modern, open source Linux operating system for desktop, servers and other devices.
Ubuntu is a great Linux operating system for beginners.
To get started listing installing packages on Ubuntu Linux, follow the steps below.
How to list packages with apt on Ubuntu Linux.
apt is a command-line tool to manage packages on Ubuntu Linux. This tool is used to install, remove and perform other package related tasks on Ubuntu Linux. You can use it to list installed packages as well.
If you want to see all the installed packages on Ubuntu Linux using apt, run the commands below.
sudo apt list --installed
When you run the commands above, it will list all installed packages including information about the packages versions and architecture.
Listing... Done accountsservice/focal-updates,focal-security,now 0.6.55-0ubuntu12~20.04.4 amd64 [installed,automatic] acl/focal,now 2.2.53-6 amd64 [installed,automatic] acpi-support/focal,now 0.143 amd64 [installed,automatic] acpid/focal,now 1:2.0.32-1ubuntu1 amd64 [installed,automatic] adduser/focal,focal,now 3.118ubuntu2 all [installed,automatic] adwaita-icon-theme/focal-updates,focal-updates,now 3.36.1-2ubuntu0.20.04.2 all [installed,automatic] aisleriot/focal,now 1:3.22.9-1 amd64 [installed,automatic] alsa-base/focal,focal,now 1.0.25+dfsg-0ubuntu5 all [installed,automatic] alsa-topology-conf/focal,focal,now 1.2.2-1 all [installed,automatic] alsa-ucm-conf/focal-updates,focal-updates,now 1.2.2-1ubuntu0.10 all [installed,automatic]
If the list of installed packages is long, you can pipe the output to less to make it easy to read and create a page break. Press the space bar to move to the next screen.
sudo apt list --installed | less
How to list packages with with dpkg-query on Ubuntu Linux
One can also use the dpkg-query command to list installed packages on Ubuntu. If the way the list is formatted with the apt command isn’t adequate, you can use the dpkg-query command.
Run the commands below to list installed packages using the dpkg-query command.
sudo dpkg-query -l
You can also pipe the command to less to create make it easier to read as above.
sudo dpkg-query -l | less
You should see similar list as the one below.
||/ Name Version Architecture Description +++-==========================================-=====================================-============-=====================> ii accountsservice 0.6.55-0ubuntu12~20.04.4 amd64 query and manipulate > ii acl 2.2.53-6 amd64 access control list -> ii acpi-support 0.143 amd64 scripts for handling > ii acpid 1:2.0.32-1ubuntu1 amd64 Advanced Configuratio> ii adduser 3.118ubuntu2 all add and remove users > ii adwaita-icon-theme 3.36.1-2ubuntu0.20.04.2 all default icon theme of>
dpkg-query list is formatted appropriately as you can see above.
If you want to be little fancy, you can count the number of packages installed by running the commands below.
sudo dpkg-query -f '${binary:Package}\n' -W | wc -l
The command above should output a number of packages installed on Ubuntu.
That should do it!
Conclusion:
This post showed you how to list all installed packages on Ubuntu Linux. If you find any error above or have something to add, please use the comment form below.