This post shows students and new users the steps to list all packages installed on Ubuntu Linux. Knowing what packages are installed on Ubuntu Linux can be important, especially when you are looking for vulnerable packages or building another machine and want to install the same packages on it.

There are several ways to view installed packages on Ubuntu Linux, and we will show you a few steps below that will list, count, and display the currently installed packages.

Although this post is written for Ubuntu Linux, it should also be 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 Ubuntu Linux. Ubuntu is the modern open source Linux operating system for desktops, servers, and other devices.

Ubuntu is a great Linux operating system for beginners.

To start listing package installation on Ubuntu Linux, follow the steps below.

How to list packages with apt in Ubuntu Linux.

suitable is a command line tool for managing packages on Ubuntu Linux. This tool is used to install, remove, and perform other package-related tasks on Ubuntu Linux. You can also use it to list installed packages.

If you want to see all packages installed on Ubuntu Linux using apt, run the following commands.

sudo apt list --installed

When you run the above commands, it will list all installed packages, including information about the versions and architecture of the packages.

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 easier to read and create a page break. Press the space bar to go to the next screen.

sudo apt list --installed | less

How to list packages with dpkg-query on Ubuntu Linux

You can also use the dpkg-query command to list the packages installed in Ubuntu. If the way the list is formatted with the apt command is not suitable, you can use the dpkg-query command.

YOU CAN ALSO READ:   How to install Tomcat on Ubuntu Linux

Run the following commands to list the installed packages using the dpkg-query command.

sudo dpkg-query -l

You can also pipe the command to less to create and make reading easier as noted above.

sudo dpkg-query -l | less

You should see a list similar to the following.

||/ 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>

The dpkg-query list is in the appropriate format as you can see above.

If you want to be a bit fancy, you can count the number of installed packages by running the following commands.

sudo dpkg-query -f '${binary:Package}n' -W | wc -l

The above command should generate a series of packages installed on Ubuntu.

You should do that!

Conclusion:

In this tutorial we have seen how to list all the packages installed in Ubuntu Linux. If you find any errors above or have something to add, use the comment form below.

Write A Comment