Ubuntu apt-get completely uninstalls packages

apt-get purge / apt-get --purge remove
removes installed packages (without keeping configuration files).
For example, package a depends on package b, then executing this command will delete a, and the configuration file

apt-get autoremove will not be retained
to delete packages (including installed packages) that were installed to satisfy dependencies but are no longer needed now. Keep the configuration file.

apt-get remove
removes installed packages (keeps configuration files), does not remove dependent packages, and keeps configuration files.

The underlying package of apt-get autoclean
APT is dpkg, and when dpkg installs Package, it will put *.deb in /var/cache/apt/archives/, apt-get autoclean will only delete /var/cache/apt/archives / Debs that have expired.

apt-get clean
Use apt-get clean to delete all debs in /var/cache/apt/archives/, which can be understood as rm /var/cache/apt/archives/*.deb.

Specifically, you can run the following commands:

# Delete software and its configuration files
apt-get --purge remove <package>
# Delete useless dependencies
apt-get autoremove <package>
# At this time, there is "rc" in the list of dpkg state of the package, you can execute the following command for final cleanup:
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

Of course, if you want to delete the temporary software installation package, you can also use the clean command.

Guess you like

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