Debian software package management tool command (dpkg, Apt-Get) Details

Source: Internet
Author: User

From: http://www.opsers.org/base/debian-package-management-tools-command-dpkg-apt-get-detailed.html

1. dpkg package management tool 
Dpkg-Info "package name"-list the package names after the package is unwrapped.
Dpkg-L-list all packages in the current system. You can use it with the parameter less in the split screen view.
Dpkg-L | grep-I "package name"-view the packages associated with "package name" in the system.
Dpkg-S: query the details of installed packages.
Where the installed software package is installed in the dpkg-l query system.
Which package does dpkg-s query system belong to a file.
Dpkg-I queries the detailed information of the Deb package. After downloading a software package to a local computer, check whether it is installed ).
Dpkg-I install the software package manually (this command does not solve the dependency problem before the Software Package). If you encounter software dependency problems when installing a software package, you can use apt-get-F install to solve the reliability problem.
Dpkg-r uninstall the software package. The configuration file does not exist.
Dpkg-P all unmount (but it still cannot solve the dependency problem of the software package)
Dpkg-reconfigure Reconfiguration
2. APT advanced package management tools

 


(1) "synaptic" of GTK graphics, which is the front-end tool of apt.
(2) "aptitude", which is also the front-end tool of apt.
You can use the apt management tool to manage packages by using the following methods:
(1) Use the installation disk as the source. The method is as follows:
Apt-CDROM ident scan information of the disc
Apt-CDROM Add add a CD Source
(2) The most common method is to add the source to/etc/APT/source. list, and then update the apt-Get Update column.
Common commands of APT management tools
Apt-Cache can be used with different sub-commands and parameters to find and display software, package information, and package trust relationships.
Apt-Cache stats displays statistics of all the debain data sources used by the current system.
Apt-cache search + "package name" to find related software packages.
Apt-Cache show + "package name" to display the details of the specified software package.
Apt-Cache depends + "package name", you can find the dependency of the software package.
Apt-Get upgrade: update all packages in the system to the latest version.
Apt-Get install installation package
Apt-get-reindtall install reinstall the Software Package
Apt-Get remove uninstall software package
Apt-get-Purge remove uninstall software package completely
Apt-Get clean clear useless software packages
Before using the command apt-Get install, download the software package to/var/Cache/APT/archives and then install it. so we can use apt-Get clean to clear software packages in the/var/Cache/APT/archives directory.
Source code package installation
Apt-Cache showsrc: Find the file information of the source package (before download)
Apt-Get source to download the source package.
Apt-Get build-dep + "package name" build the compiling environment of the source package.

3. Some basic usage of APT-Get and dpkg
Apt-Get install packagename # install a new software package
Apt-Get remove packagename # uninstall an installed software package (keep the configuration file)
Apt-get-Purge remove packagename # uninstall an installed software package (delete the configuration file)
Dpkg-force-all-Purge packagename # force uninstall, high risk!
Apt-Get upgrade # update all installed software packages
Apt-Get dist-upgrade # upgrade the system to the new version
Apt-Get clean # Clear all software caches
Apt-Get autoclean # Clear Old Version Software Cache
Apt-Get autoremove # Delete isolated software that is no longer used by the System
Apt-CDROM add # Add a CD Source
Auto-apt run./configure # automatic processing of H files is missing during compilation
Apt-cache search Regular Expression # search strings in the package list
Dpkg-l Regular Expression # list all software packages that match the pattern
Dpkg-L | grep ^ RC | awk '{print $2}' | # xargs dpkg-P # Clear the residual configuration files of all deleted packages
Dpkg-I,-install XXX. Deb # Install XXX. Deb package: dpkg-install stardict_3.0.1-1_i386.deb
Dpkg-R,-remove,-P,-Purge package... |-A |-pending # delete a software package: dpkg-r stardict

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.