YouTube Icon

Code Playground.

How to List Installed Packages on Ubuntu

CFG

How to List Installed Packages on Ubuntu

In this instructional exercise, we will tell you the best way to rundown and channel introduced bundles on Ubuntu. Realizing how to list introduced bundles on your Ubuntu framework can be useful in circumstances where you need to introduce similar bundles on another machine or on the off chance that you need to re-introduce your framework. 

We will likewise tell you the best way to check whether a particular bundle is introduced, exclude introduced bundles and discover the variant of an introduced bundle. 

In spite of the fact that this instructional exercise is composed for Ubuntu similar guidelines apply for any Ubuntu-based dissemination, including Kubuntu, Linux Mint and Elementary OS. 

List Installed Packages with Apt

adept is an order line interface for the bundle the executives framework. It was presented in Ubuntu 14.04 and joins the most usually utilized orders from able get and adept store including a choice to list introduced bundles. 

To list the introduced bundles on your Ubuntu framework utilize the accompanying order: 

sudo apt list --installed

As should be obvious from the yield over, the order prints a rundown of all introduced bundles including data about the bundles variants and design. 

The bundles list is long and it is a smart thought to pipe the yield to less to make it simpler to peruse: 

sudo apt list --installed | less

To see if a particular bundle is introduced you can channel the yield with the grep order . For instance, to see whether the screen bundle is introduced on our framework we will run: 

sudo apt list --installed | grep screen
screen/bionic,now 4.6.2-1 amd64 [installed]

The yield above shows that we have screen variant 4.6.2-1 introduced on our framework. 

List Installed Packages with dpkg-query

On the off chance that you are running a more seasoned Ubuntu form ,, at that point you can utilize the dpkg-question order to list the bundles: 

sudo dpkg-query -l | less

The order will show you a rundown of all introduced bundles including the bundles renditions, engineering, and a short depiction. 

You can channel the dpkg-inquiry - l yield with grep same as the able yield: 

sudo dpkg-query -l | grep package_name

Create a list of all installed packages

To make a rundown of the names of all introduced bundles on your Ubuntu or Debian framework and save it in a record named packages_list.txt, run the accompanying order: 

sudo dpkg-query -f '${binary:Package}\n' -W > packages_list.txt

Since you have the rundown, in the event that you need to introduce similar bundles on your new worker you can do that with: 

sudo xargs -a packages_list.txt apt install

Count the number of packages installed on your Ubuntu machine

To discover the number of bundles are introduced on your framework you can utilize a similar order as in the past yet as opposed to diverting the yield to a record you can pipe it to the wc utility and tally the lines: 

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

As should be obvious I have 544 bundles introduced on my Ubuntu worker. 

Conclusion

At this point you should realize how to rundown and channel introduced bundles on your Ubuntu framework. On the off chance that you need to study the adept order open your terminal and type man well-suited. 

Don't hesitate to leave a remark on the off chance that you have any inquiries.




CFG