The difference between apt-get and dpkg command to install software under ubuntu

Reprinted from: http://blog.csdn.net/fx_abc/article/details/51812816


"dpkg" is short for "Debian Package". A package management system specially developed for "Debian" to facilitate software installation, update and removal. All "Linux" distributions derived from "Debian" use "dpkg", such as "Ubuntu", "Knoppix", etc. Here are some common uses of "Dpkg": 

1. "dpkg -i" installs a "Debian" package, such as the one you downloaded manually. 2. The contents listed in "dpkg -c ". 3. "dpkg -I" extracts package information from . 4. "dpkg -r" removes an installed package. 5. "dpkg -P" completely removes an installed package. Unlike "remove", which just deletes data and executable files, "purge" also deletes all configuration files. 6. "dpkg -L" lists all files installed. Also see "dpkg -c" to check the contents of a .deb file. 7. "dpkg -s" displays information about the installed packages. Also see apt-cache to display package information in a Debian archive, and dpkg -I to display package information extracted from a .deb file. 8. "dpkg-reconfigure" reconfigures an installed package if it uses "debconf" (debconf provides a unified configuration interface for package installation).

The difference between the two is that dpkg bypasses the apt package management database to operate the software package, so the package you have installed with dpkg can be installed again with apt. The system does not know that it has been installed before, and it will overwrite the previous dpkg installation.

 1. dpkg is used to install .deb files, but it will not resolve module dependencies, and will not care about the software in ubuntu's software repository, it can be used to install local deb files.

 2. apt will solve and install the module dependency problem, and will consult the software repository, but will not install the local deb file, apt is a software management tool built on dpkg.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325822401&siteId=291194637