However, how can you tell which package is installed or how you can retrieve the list of the installed packages on your system? Do you know how to do that? We are here to rescue you. Now we will demonstrate how
The apt stands for Advanced Packaging Tool whereas the “apt command” is used to interact with this package management system. For the first time, it was embedded in Ubuntu 14.04. This package management utility has the collective features of the most regularly used commands from apt-cache and apt-get. It can also list the installed packages while the apt-get command lacks this basic option.
Using the apt utility, if you want to list installed packages on your system, for that, write out the below-given command in your terminal:
The execution of the above-given command will list all the packages that you have installed with apt. It will also list out the dependencies present on your system. This implies that the list will show you the installed applications; moreover, you will see the large number of libraries and packages that you did not install directly:
The simple “apt list –installed” command also lists information related to packages, such as their version and architecture. If you want to make this list easier to read, you can pipe the output of the apt to the “less” command using [“|”] pipe operator. The less command will show you the list of installed packages one page at a time:
You have to press “Enter” to move to the next page of the list:
The grep command can be utilized to filter the apt command’s output for verifying if our searched package exists on the system or not. This command lookout for lines that have the pattern specified in the input and then it outputs the matched line to the terminal. For instance, we will combine apt and grep commands using the pipe operator [“|“] to see if “firefox” exists on our system or not:
The output will show you the following information:
The apt utility might not be available on systems running older versions of Ubuntu. Alternatively, those users can utilize the “dpkg” command. The dpkg utility is used for managing Debian packages. It provides various options, including dpkg-query, which can display information about packages in the dpkg database.
The “-l” option is added in the “dpkg-query” command for listing the installed packages. You can also use the pipe operator [“|”] to pipe the output of the “dpkg-query” command to the “less” command. This will list the installed packages one page at a time:
The execution of the above-given command will print out a list of installed packages on your system with their version, architecture, and a brief description:
To search for a specific package installed on your system, you execute the dpkg command with the grep command. Adding the pipe operator [“|”] will pipe the output of the “dpkg” command to the “grep”. Then the grep command will search for the specific package in the provided output.
For instance, we will search for the “firefox” in the list of installed packages as follows:
If you want to create a list of installed applications, you can also perform this operation with the help of “dpkg-query” command. To do so, execute the below-given command in your Ubuntu terminal. This command will save the list of installed packages in the “list.txt” file:
Now, write out the cat command with the name of the file containing the list, which is “list.txt” in our case:
This will show you the following output:
It is quite helpful to know how to list installed packages on your Ubuntu system in situations where you have to install the same packages on your system, for instance, when you are reinstalling Ubuntu or replicating the environment on any other machine. This article demonstrated how you can list the installed packages on your Ubuntu system. Try them out for a better understanding and keep following Linux Hint.
In this article, we will see how to Install Google Cloud BigQuery Python client library…
Nov 15,2024 Wallpaper Contest for Xfce 4.20 open for voting The submission phase for the…
MicroCloud 2.1.0 LTS is now available, expanding the number of Canonical infrastructure solutions with a…
Canonical is thrilled to be joining forces with Dell Technologies at the upcoming Dell Technologies…
In today’s massive private mobile network (PMN) market, one of the most common approaches to…
Welcome to the Ubuntu Weekly Newsletter, Issue 865 for the week of November 3 –…