dpkg common commands

dpkg -i package.deb ###Install the package
dpkg -r package ###Delete the package
dpkg -P package ###Delete the package (including configuration files)
dpkg -L package ###List the files associated with the package
dpkg -l package ###Display the version of the package
dpkg --unpack package.deb ###Unpack the content of the deb package
dpkg -S keyword ###Search the content of the package to which it belongs
dpkg -l ###List currently installed The package
dpkg -c package.deb ###List the contents of the deb package
dpkg --configure package ###Configure the package
dpkg-reconfigure package ###Reconfigure an installed package
dpkg-reconfigure --frontend=dialog debconf ###If you choose the wrong configuration information during installation, you can change it back here.
dpkg --force-all --purge ###Some software is difficult to uninstall, and it also prevents the application of other software, you can use this, It's a bit of an adventure though.

 

More options can be queried through dpkg -h. Some commands require superuser privileges to be executed. Therefore, when executing, it is generally necessary to add sudo before dpkg (for example: sudo dpkg -i package.deb).

 

dpkg configuration and cache information: All package information in the system is under /var/lib/dpkg. The /var/lib/dpkg/info directory saves the information and management files of each package. This information is provided for understanding only , generally do not need to be changed.

 

The role of each file is as follows:


The ".conffiles" file records the configuration list of the package.
The ".list" file records the file list of the package, and the user can find the specific installation location of the package file in the file.
The ".md5sums" file records the md5 information. The
".config" file is the package installation configuration script.
The ".postinst" script is used to complete the configuration work after the Debian package is unpacked, and is usually used to execute commands and services related to the installed package. Reboot.
The ".preinst" script is run before debain unpacks, and its main purpose is to stop the package service that is about to be upgraded until the package installation or upgrade is complete.
The ".prerm" script is responsible for stopping the daemon associated with the package Service, which is executed before removing package association files.
The ".postrm" script is responsible for modifying package links or file associations, or deleting files created by it.

Guess you like

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