Beta 42

Research and Development

Menu

List Installed Software

On Ubuntu or Ubuntu Linux-based systems, it is easy to list all application packages installed in a command line application in Terminal, without third-party graphical user interface software. Try the following commands to list all the software in Ubuntu and find out the differences.

Apt Packages

apt list --installed

The list will consist of all the applications directly installed, as well as all the libraries and other packages that were indirectly installed (e.g. as dependencies).

dpkg --get-selections

dpkg-query -l

dpkg -l |awk '/^[hi]i/{print $2}'

dpkg -l | grep '^ii '

apt-cache pkgnames

grep ' installed ' /var/log/dpkg.log /var/log/dpkg.log.1 | awk '{print $5}' | sort -u

The following command lists all packages intentionally installed by the apt command:

apt-mark showmanual

(zcat $(ls -tr /var/log/apt/history.log*.gz); cat /var/log/apt/history.log) 2>/dev/null | \
  egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:'

To focus the search on a specific package(s), then here are a couple of commands that might help out:

apt show program_name

apt list --installed | grep program_name

apt -qq list program_name --installed

Following the above methods, you will get a list of all the installed packages in alphabetical order. For most users, the list will be a long one. Try piping the output using less.

You can also refer to the dpkg command's log or the apt command's log if you want the list of installed packages to be presented in chronological order. Doing that can help you quickly pinpoint which apps or packages were installed recently.

To list all the packages as well as dependencies that were recently installed, along with the time they were installed on the system, use the following command:

grep " install " /var/log/dpkg.log

The following command will search the apt command's log:

grep " install " ~/.bash_history

Upgradable Packages

If you are looking for a list of all the packages on your Ubuntu system that needs to be updated, then here is the command to help you out:

apt list –-upgradable

Count Installed Packages

Here is the corresponding command:

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

It generates a list of all the installed packages that are due for an update.

List Package Versions

To list all versions of a package, execute the following command:

apt-cache policy Package_Name

The system will present all the available package versions in a repository. This is a repository-wide search. You will get results even for packages that have not been installed on your system.

Snap Packages

For listing the Snap packages installed on your system, you could use the following command:

snap list

To list the package names only:

snap list | awk '{print $1}'

Flatpack Packages

Similarly, for listing the Flatpak packages installed on your system:

flatpack list