How do I see what packages are installed on Ubuntu Linux?

There are two main commands you can use to list installed packages on Ubuntu Linux:

1. apt list –installed

This command will list all packages that are installed on your system, including their version numbers. For example, to list all packages that start with the word “apache”, you would use the following command:

apt list --installed | grep apache

2. dpkg-query -l

This command will also list all packages that are installed on your system, but it will provide more detailed information about each package, such as its size, installation date, and conflict information. For example, to list all packages that are installed in the /usr/share/doc directory, you would use the following command:

dpkg-query -l | grep /usr/share/doc

Here is a table summarizing the differences between the two commands:

Command Features
apt list –installed Lists all installed packages and their version numbers.
dpkg-query -l Lists all installed packages and provides more detailed information about each package, such as its size, installation date, and conflict information.