Two kinds of package management tools under Debian comparison of dpkg and apt

Source: Internet
Author: User


Dpkg and apt are two commonly used package management mechanisms under Debian, and the following is a detailed analysis of the differences and uses.

Dpkg and apt Introduction

DPKG is used to install the. deb file, but does not resolve the module dependencies, and does not care about the software in the Ubuntu software warehouse, which can be used to install the local deb file.

apt resolves and installs the module dependencies and consults the repositories, but does not install the local deb file, APT is a software management tool built on top of dpkg.

Dpkg and APT usage

The use of dpkg

Dpkg-l View information about packages that are already installed in the current system
Dpkg-l (package name) View a detailed list of software files that have been installed in the system
Dpkg-s View details of a specified package that has been installed
Dpkg-s view a file in the system that belongs to that package;
Installation of dpkg-i *.deb files
Dpkg-r *.deb file Uninstall;
Dpkg-p complete uninstall including software configuration files and so on
View the Deb Package command that is not installed
Dpkg-c query the files contained in the Deb package file Rpm-qlp
Dpkg-i Query Deb package for more information
Add Description:

The most common is-i,-r. Simple, install/uninstall.


The usage of APT

Apt-cache Search Package Package
Apt-cache Show package get information about the package, such as description, size, version, etc.
Apt-get Install package installation package
Apt-get Install package--Reinstall reinstall package
Apt-get-f Install forced installation
Apt-get Remove Package Delete Package
Apt-get Remove Package--purge delete package, including deletion of configuration files, etc.
Apt-get autoremove automatically deletes unwanted packages
Apt-get Update Source
Apt-get Upgrade Update installed packages
Apt-get Dist-upgrade Upgrade System
Apt-get Dselect-upgrade use Dselect upgrade
Apt-cache depends package understand usage dependencies
Apt-cache Rdepends Package understand a specific dependency
Apt-get BUILD-DEP Package Installation-related compilation environment
Apt-get Source package Download the source code for this package
Apt-get clean && sudo apt-get autoclean cleanup download file archive
Apt-get check checks for corrupted dependencies


"Search Package"
Apt-cache Search Package

"View Binary Package Basics"
Apt-cache showpkg Package

"View binary Package Details"
Apt-cache Show Package A complete description of the details of the package and its purpose if you have a package installed on your system and the system searches for a new version of it, the system lists their details together.

"View Source package Information"
Apt-cache SHOWSRC Package

"View dependencies for packages"
Apt-cache depends package

"View packages that can be updated"
Apt-show-versions

"Installing and removing packages"
If a user accidentally destroys an installed package and wants to fix it, or simply reinstall the latest version of some of the files in the package, you can use the following--reinstall option:
$ apt-get--reinstall Install GDM

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.