Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to view installed Linux packages

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to view the installed Linux package", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to view the installed Linux package" this article.

These most useful commands let you know about the packages installed on your Debian class Linux system.

Have you ever thought of thousands of software packages installed on your Linux system? Yes, I said "thousand". Even a fairly average Linux system may have thousands of software packages installed. There are many ways to get details about what these packages are.

First, to quickly get the number of installed packages on a Debian-based distribution, such as Ubuntu, use apt list-- installed, as follows:

$apt list-- installed | wc-l2067

This number is actually one more, because the output contains "Listing..." As its line. This command will be more accurate:

$apt list-- installed | grep-v "^ Listing" | wc-l2066

For more information about all of these packages, browse the list as follows:

$apt list-- installed | moreListing...a11y-profile-manager-indicator/xenial,now 0.1.10-0ubuntu3 amd64 [installed] account-plugin-aim/xenial,now 3.12.11-0ubuntu3 amd64 [installed] account-plugin-facebook/xenial,xenial,now 0.12 * 16.04.20160126-0ubuntu1 all [installed] account-plugin-flickr/xenial,xenial,now 0.12 * 16.04.20160126-0ubuntu1 all [installed] account-plugin-google/xenial,xenial Now 0.12-16.04.20160126-0ubuntu1 all [installed] account-plugin-jabber/xenial,now 3.12.11-0ubuntu3 amd64 [installed] account-plugin-salut/xenial,now 3.12.11-0ubuntu3 amd64 [installed]

This requires looking at a lot of details-especially to keep your eyes wandering through all 2000-odd documents. It contains the package name, version, and so on, as well as more but not the most easily parsed information for us humans. Dpkg-query makes the descriptions easier to understand, but these descriptions will fill your command window unless the window is very wide. Therefore, in order to make this article easier to read, the following data show that it has been divided into the left and right sides.

On the left:

$dpkg-query-l | moreDesired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend | / Err?= (none) / Reinst-required (Status) Err: uppercase=bad) | | / Name Version + +-=-=-ii a11y-profile-manager-indicator 0.1.10-0ubuntu3 ii account-plugin-aim 3.12.11-0ubuntu3 Ii account-plugin-facebook 0.12, 16.04.20160126-0ubuntu1 ii account-plugin-flickr 0.12, 16.04.20160126-0ubuntu1 ii account-plugin-google 0.12, 16.04.20160126-0ubuntu1 ii account -plugin-jabber 3.12.11-0ubuntu3 ii account-plugin-salut 3.12.11-0ubuntu3 ii account-plugin-twitter 0.12 million 16.04.20160126-0ubuntu1 rc account-plugin-windows-live 0.11-14.04.20140409.1-0ubuntu2

On the right side:

Architecture Description=-====amd64 Accessibility Profile Manager-Unity desktop indicatoramd64 Messaging account plugin for AIMall GNOME Control Center account plugin for single signon-facebookall GNOME Control Center account plugin for single signon-flickrall GNOME Control Center account plugin for single signonamd64 Messaging account plugin for Jabber/XMPPamd64 Messaging account plugin for Local XMPP (Salut) all GNOME Control Center account plugin for single signon-twitterall GNOME Control Center account plugin for single signon-windows live

The ii and rc names at the beginning of each line (see "left" above) are package status indicators. * letters indicate the expected status of the package:

U-unknown

I-installation

R-remove / reverse installation

P-clear (also includes configuration files)

H-retention

The second represents the current state of the package:

N-not installed

I-installed

C-configuration file (only configuration files are installed)

U-unpackaged

F-semi configuration (configuration failed for some reason)

H-semi-installation (configuration failed for some reason)

W-wait for trigger (the packet waits for another packet trigger)

T-pending trigger (the packet is triggered)

The R added at the end of the usual two-character field indicates that it needs to be reinstalled. You may never encounter this.

An easy way to quickly view the overall package status is to calculate the number of packages contained in different states:

$dpkg-query-l | tail-n + 6 | awk'{print $1}'| sort | uniq-c 2066 ii 134 rc

I excluded the first five lines from the dpkg-query output above because they are header lines that confuse the output.

These two lines basically tell us that 2066 packages should be installed on this system, while 2066 other packages have been removed, but configuration files have been left behind. You can always delete the remaining configuration files of the package using the following command:

$sudo dpkg-purge xfont-mathml

Note that if both the package binaries and configuration files are already installed, the above command removes both.

The above is all the contents of the article "how to View the installed Linux package". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report