In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces linux how to find the software package dependency, the article is very detailed, has a certain reference value, interested friends must read it!
Apt-cache is an apt package management tool that queries apt's binary package cache files. Through it, we can query the status information of the package.
Apt-cache show package_name
Displays information about the software, including version number, installation status, package dependencies, etc.
Apt-cache search package_name
Search for software packages, using regular expressions.
Apt-cache showpkg package_name
Displays dependency information for the package.
Apt-cache policy package_name
Displays the installation status and version information of the package.
Apt-cache depends package_name
Displays the packages on which the specified package depends.
Apt-cache rdepends package_name
Displays the reverse dependency of the package, that is, what package depends on the package you specify
-
1.apt-cache showpkg
Display some general information about the software package
Example: apt-cache showpkg openssh
2.apt-cache stats
Show relevant statistics and show relevant statistical information
3.apt-cache dump
Displays a brief description of each package in the cache
4.apt-cache unmet
Show inconsistent dependencies
5.apt-cache show
Displays record information for the specified package. Similar to rpm-qi
6.apt-cache search
Find the software package, similar to rpm-qa | grep package_name
Example: apt-cache search openssh
7.apt-cache depends
Show the dependencies of the package
8.apt-cache pkgnames
List all software packages
-
Apt-get and apt-cache are package management tools under the command line in Ubuntu Linux. The GUI version of apt-get is the Synaptic package manager. In this article, we will show 15 different examples of apt-get and apt-cache commands.
Example: 1 list all available packages linuxtechi@localhost:~$ apt-cache pkgnamesaccount-plugin-yahoojpceph-fusedvd+rw-toolse3gnome-commander-datagrub-gfxpayload-listsgweled.. Example: 2 search packages with keywords
This command is useful when you are unsure of the package name, as long as you type the keywords associated with the package after the apt-cache.
Linuxtechi@localhost:~$ apt-cache search "web server" apache2- Apache HTTP Serverapache2-bin-Apache HTTP Server (binary files and modules) apache2-data-Apache HTTP Server (common files) apache2-dbg-Apache debugging symbolsapache2-dev-Apache HTTP Server (development headers) apache2-doc-Apache HTTP Server (on-site documentation) apache2-utils-Apache HTTP Server (utility programs for web servers).. ..
Note: if you install the "apt-file" package, we can use the configuration file to search for the package as follows.
Linuxtechi@localhost:~$ apt-file search nagios.cfgganglia-nagios-bridge: / usr/share/doc/ganglia-nagios-bridge/nagios.cfgnagios3-common: / etc/nagios3/nagios.cfgnagios3-common: / usr/share/doc/nagios3-common/examples/nagios.cfg.gzpnp4nagios-bin: / etc/pnp4nagios/nagios.cfgpnp4nagios-bin: / usr/share/doc/pnp4nagios/examples/nagios.cfg example: 3 displays the basic information of a specific package linuxtechi@localhost:~$ apt-cache Show postfixPackage: postfixPriority: optionalSection: mailInstalled-Size: 3524Maintainer: LaMont Jones Architecture: amd64Version: 2.11.1-1Replaces: mail-transport-agentProvides: default-mta Mail-transport-agent... Example: 4 list the package dependencies linuxtechi@localhost:~$ apt-cache depends postfixpostfix Depends: libc6 Depends: libdb5.3 Depends: libsasl2-2 Depends: libsqlite3-0 Depends: libssl1.0.0 | Depends: debconf Depends: cdebconf debconf Depends: netbase Depends: adduser Depends: dpkg.... Example: 5 use apt-cache to display cache statistics linuxtechi@localhost:~$ apt-cache stats Total package names: 60877 (1218 k) Total package structures: 102824 (5758 k) Normal packages: 71285 Pure virtual packages: 1102 Single virtual packages: 9151 Mixed virtual packages: 1827 Missing: 19459Total distinct versions: 74913 (5394k) Total distinct descriptions: 93792 (2251k) Total dependencies: 573443 (16.1 M) Total ver/file relations: 78007 (1872k) Total Desc/File relations: 93792 (2251k) Total Provides mappings: 16583 (332) K) Total globbed strings: 171171Total dependency version space: 2665 kTotal slack space: 37.3kTotal space accounted for: 29.5m example: 6 update the warehouse with "apt-get update"
Using the command "apt-get update", we can resynchronize the file index from the source repository. The index of the package is retrieved from "/ etc/apt/sources.list".
Linuxtechi@localhost:~$ sudo apt-get update Ign http://extras.ubuntu.com utopic InRelease Hit http://extras.ubuntu.com utopic Release.gpg Hit http://extras.ubuntu.com utopic Release Hit http://extras.ubuntu.com utopic/main Sources Hit http://extras.ubuntu.com utopic/main amd64 Packages Hit http://extras.ubuntu.com utopic/main i386 Packages Ign http://in.archive.ubuntu.com utopic InRelease Ign http://in.archive.ubuntu.com utopic- Updates InRelease Ign http://in.archive.ubuntu.com utopic-backports InRelease.... Example: 7 install package linuxtechi@localhost:~$ sudo apt-get install icinga using apt-get
The above command installs a package called "icinga".
Example: 8 upgrade all installed packages sample linuxtechi@localhost:~$ sudo apt-get upgrade: 9 update specific packages
The "install" option in the apt-get command is followed by "- only-upgrade" to update a specific package, as follows:
Linuxtechi@localhost:~$ sudo apt-get install filezilla-only-upgrade example: 10 uninstall the package linuxtechi@localhost:~$ sudo apt-get remove skype using apt-get
The above command only deletes the skype package. If you want to delete its configuration file, use the "purge" option in the apt-get command. As follows:
Linuxtechi@localhost:~$ sudo apt-get purge skype
We can use the above two commands together:
Linuxtechi@localhost:~$ sudo apt-get remove-- purge skype example: 11 download package linuxtechi@localhost:~$ sudo apt-get download icingaGet:1 http://in.archive.ubuntu.com/ubuntu/ utopic/universe icinga amd64 1.11.6-1build1 [1474 B] Fetched 1474 B in 1s (1363 Bax) in the current directory
The above directory will download the icinga package to your current working directory.
Example: 12 Clean the disk space occupied by the local package linuxtechi@localhost:~$ sudo apt-get clean
The above command empties the disk space occupied by packages downloaded by apt-get.
We can also use the "autoclean" option instead of "clean". The main difference between the two is that autoclean cleans up downloads that are no longer used and useless.
Linuxtechi@localhost:~$ sudo apt-get autocleanReading package lists... DoneBuilding dependency treeReading state information... Done example: 13 delete a package using "autoremove"
When you use "autoremove" in the apt-get command, it removes packages that are installed to satisfy dependencies and are not currently in use.
Linuxtechi@localhost:~$ sudo apt-get autoremove icinga example: 14 shows the package's update log linuxtechi@localhost:~$ sudo apt-get changelog apache2Get:1 Changelog for apache2 (http://changelogs.ubuntu.com/changelogs/pool/main/a/apache2/apache2_2.4.10-1ubuntu1/changelog) [195 kB] Fetched 195 kB in 3s (60.9 kB/s)
The above command downloads apache2's update log and displays it in pages on your screen.
Example: 15 use the "check" option to display a corrupted dependency linuxtechi@localhost:~$ sudo apt-get checkReading package lists... DoneBuilding dependency treeReading state information... Done above is all the contents of the article "how to find package dependencies in linux". Thank you for reading! Hope to share the content to help you, more related 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.