×

One of the several duties of a Linux administrator is to manage and keep track of the installed packages on a system. 

In the Ubuntu system, you can install a package through different methods which involve installation through apt, dpkg, and snap. 

Ubuntu also comes with a lot of packages pre-installed on it. 

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform Linux related tasks.

In this context, we shall look into how to list all the installed packages on Ubuntu including the packages which come preinstalled and those which were manually installed.


How to List Installed Packages on Ubuntu System ?

Here, we will be dealing on the following areas:

1. List installed packages using apt command

2. List installed packages using dpkg command

3. List installed snap packages

4. Count installed packages


1. How to List Installed Packages using apt Command ?

Apt is a command-line package management tool for Debian based Linux distributions that is used to install, update, and remove the packages from a system. With apt, you can list the installed packages on a system.

To list the installed packages in Ubuntu using the apt command, issue the following command in Terminal:

$ sudo apt list --installed

Now enter the password for sudo, after which it displays a long list of the installed packages in alphabetical order. 

The list will include the packages that were installed through dpkg and apt commands. This list also includes the dependencies. 

The packages displayed in the list also includes the version information of the installed packages.

As the displayed list is so long, it is a little hard to find a specific package. 

If you need to verify whether a specific package is installed or not, you can pipe the output of the above command to grep as follows:

$ apt list --installed | grep package_name

For example, to check whether the Apache server is installed or not, issue the following command in Terminal:

$ apt list --installed | grep apache


2. How to List Installed Packages using dpkg Command ?

Dpkg is also used for installing, building, and removing packages in Debian based OS. It can also be used to list installed packages in a system.

To list the installed packages in Ubuntu using the apt command, issue the following command in Terminal:

$ dpkg --list

Now enter the password for sudo, after which it displays a long list of all the installed packages in alphabetical order. 

The packages displayed in the list also includes the version information of the installed packages.

As the displayed list is so long, it is a little hard to find a specific package. If you need to verify whether a specific package is installed or not, you can pipe the output of the above command to grep as follows:

$ dpkg --list | grep package_name

For example, to check whether the Apache server is installed or not, issue the following command in Terminal:

$ dpkg --list | grep apache


3. How to List Installed Snap Packages ?

The above-described methods list the packages that were installed using apt and dpkg. It does not include the packages that were installed as snaps.

To list installed snap packages in Ubuntu, issue the following command in Terminal:

$ snap list

It will list all the snap packages installed on your system.

If you want to check whether a specific package is installed or not, you can pipe the output of the above command to grep as follows:

$ snap list | grep package_name

For example, to check whether the Skype package is installed or not, issue the following command in Terminal:

$ snap list | grep skype


How to Count Installed Packages on Ubuntu ?

You can also count the number of installed packages on your Ubuntu system. Issue the following command to do so:

$ dpkg --list | grep -v "^Listing" | wc --lines


[Need urgent assistance in fixing missing packages on Ubuntu System? We are available to help you today. ]


Conclusion