dpkg related 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
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, However, it is a bit risky.

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 software package. This information is provided for understanding only , generally do not need to be changed.

The functions of each file are 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.
".md5sums" The file records md5 information and is used to verify the package.
The ".config" file is the installation and configuration script of the package.
The ".postinst" script is used to complete the configuration work after the Debian package is unpacked, and is usually used to execute the installed software Restart of package-related commands and services.
The ".preinst" script is run before debain unpacks, and its main purpose is to stop the service of the package that is about to be upgraded until the package installation or upgrade is complete.
The ".prerm" script is responsible for Stops the daemon service associated with the package, executed before removing the file associated with the package.
The ".postrm" script is responsible for modifying package links or file associations, or deleting files created by it.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326613751&siteId=291194637