YouTube Icon

Code Playground.

How to List Installed Packages on Debian

CFG

How to List Installed Packages on Debian

In this guide, we'll disclose how to rundown and channel introduced bundles on Debian. We will likewise tell you the best way to check whether a particular bundle is introduced, exclude introduced bundles and discover the adaptation of an introduced bundle. 

Realizing how to list introduced bundles on your Debian based framework can be useful in circumstances where you have to introduce similar bundles on another machine or in the event that you need to re-introduce your framework. 

List Installed Packages with Apt

Adept is an order line interface for the bundle the board framework and joins the most generally utilized functionalities from well-suited get and well-suited store including a choice to list introduced bundles. 

To records all bundles introduced on your framework run the accompanying order: 

sudo apt list --installed
adduser/stable,now 3.115 all [installed]
apt/stable,now 1.4.8 amd64 [installed]
apt-listchanges/stable,now 3.10 all [installed]
apt-utils/stable,now 1.4.8 amd64 [installed]
autoconf/stable,now 2.69-10 all [installed]
automake/stable,now 1:1.15-6 all [installed]
autotools-dev/stable,now 20161112.1 all [installed,automatic]
base-files/stable,now 9.9+deb9u5 amd64 [installed]
base-passwd/stable,now 3.5.43 amd64 [installed]
bash/stable,now 4.4-5 amd64 [installed]

The order will show a rundown of all introduced bundles including data about the bundles adaptations and engineering. The furthest right segment in the yield shows whether the bundle was consequently introduced as a reliance of another bundle. 

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

sudo apt list --installed | less

To see if a particular bundle is introduced, utilize the grep order to channel the yield. For instance to discover whether the tmux bundle is introduced on the framework you would type: 

sudo apt list --installed | grep tmux
tmux/stable,now 2.3-4 amd64 [installed]

The yield above shows that you have tmux 2.3-4 introduced on your framework. 

List Installed Packages with dpkg-query

dpkg-inquiry is an order line that can be utilized to show data about bundles recorded in the dpkg information base. 

To get a rundown of all introduced bundles type: 

sudo dpkg-query -l | less

Rundown introduced bundles with dpkg-inquiry 

The order will show a rundown of all introduced bundles including the bundles adaptations, engineering, and a short portrayal. 

You can channel the dpkg-question - l yield utilizing the grep order: 

sudo dpkg-query -l | grep package_name_to_search

Create a List of all Installed Packages

The accompanying order will store the rundown of all introduced bundles on your Debian framework to a document called packages_list.txt: 

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

Since you have the rundown, you can introduce similar bundles on your new worker with: 

sudo xargs -a packages_list.txt apt install

Count the Number of Installed Packages

To discover the number of bundles are introduced on your framework you can utilize a similar order as while making a bundles list yet as opposed to diverting the yield to a document you can pipe it to the wc order to tally the lines: 

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

The yield will show the quantity of introduced bundles: 

466

Conclusion

In this instructional exercise, you figured out how to rundown and channel introduced bundles on your Debian framework. 

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




CFG