ubuntu dpkg software uninstallation
Uninstalling and clearing a package in Debian are two different concepts. The difference is that after a package is deleted (uninstalled), its configuration files will still remain in the system, and they will be deleted only when cleared. By default , Debian will only delete the configuration file, unless you explicitly point out, will delete the configuration file. If you want to clear the package, it will be deleted implicitly before the clear. To delete a package, dpkg needs to use - The remove option uninstalls the package. Unlike installation, removal only requires the package name, not the actual deb file name.
delete
#dpkg -r package_name
Delete all the configuration files of the software package in the /var/lib/dpkg/info directory, and keep the .postrm and .list files.
Finally, dpkg modifies the software status to delete in the database.
run
$dpkg -l package_name
rc package_name 1.3.10-2 free Pico clone with some new features
Clear
#dpkg -P package_name
Delete all files. All files are removed (deleted from the system).
Run the postrm script. If it still exists, run the postrm script.
Delete the postrm and list files. The remaining two files, remove postfix.postrm and postfix.files from the system.
Mark the package as not installed in the dpkg database
$dpkg -l package_name
pn package_name
Pay attention to the output status: pn This means that the package is actually cleared, but there is still a record of this package in the database. Therefore, pn clearly indicates that package_name has been installed before, appeared in the package database, and now Has been completely cleared.
Recommended Posts