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