1 min read

How to List the Installed Packages in Ubuntu?

Using the Command Line Interface

Just open a new terminal (e.g. CTRL+ALT+T) and type the following:

dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1 -n

This command will list the installed packages sorted by their size:

Let's look at this command in detail what its parameters actualy mean.

dpkg-query, as its name suggests, queries the installed packages on your Ubuntu system.

The -W parameter will list the packages. (Besides listing, there are many functions dpkg-query can do. I suggest taking a look at man dpkg-query if you're interested.)

The --showformat parameter defines what properties of the installed packages should be listed. In our case, we're interested in the packages' size and name.

This is then sorted by the sort tool. The parameter -k1 means that the first column will be sorted, the other parameter -n tell that this field should be interpreted as a numeric value.

You can combine this with the tail command if you want to list only the 10 largest packages:

dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1 -n | tail -10

Using GUI

There are, of course, GUI applications to show the installed packages on your Ubuntu system.

In this chapter we show two alternatives of them.

Ubuntu Software

The Ubuntu Software is intended to be the main package manager in Ubuntu.

You can either start it from the menus on the left, or click on Activities and start typing "Ubuntu Software".

Clicking on the Installed tab shows you the installed packages:

As you see, it shows the packages in alphabetical order.

Syantpic

Synaptic is another graphical tool for managing software packages. By default, it's not pre-installed in Ubuntu.

You can easily install it by typing the following:

sudo apt install synaptic

Synaptic's advantage is that instead of just showing the installed packages in alphabetical order, you can create advanced queries.

In order to show the installed packages by size:

  1. Click on the Status button
  2. Click on the Installed button
  3. Set the sorting to Size