What is the difference between apt-get remove and purge and autoremove in Ubuntu?

What is the difference between apt-get remove and purge and autoremove in Ubuntu?
Difference between apt-get remove and purge and autoremove in Ubuntu?


Let’s explain this by taking php package as the one to be removed.

purge

sudo apt-get purge php


This removes the package as well as its configuration files. But the dependencies will remain in the system. However, configuration files in the home directory won’t get removed.

This command is the same as using –purge option with the above remove command.

remove

sudo apt-get remove php


This removes the PHP binaries, but it’s configuration files and installed dependencies will remain in the system.

autoremove

sudo apt-get autoremove php


This will remove  the package as well as its dependencies, if those dependencies aren’t used by other packages.

sudo apt-get automove


If the package name is not specified with autoremove, it will remove all the unused dependencies in the system.

Comments

Popular posts from this blog

Failed to establish the VPN connection. This may be caused by a mismatch in the TLS version.

To make SSL VPN connection work, please turn off IE security configuration | vetechno

How to install Mysql 8.0.29 on Ubuntu 22.04 LTS | vetechno