Rate this post

Last Updated on April 21, 2020 by Vikash Ekka

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.

By Vikash Ekka

Hi All, My name is Vikash Ekka from India. I’m the founder and tech editor of https://www.vetechno.in. I have completed my Graduation in BCA. I love to write technical articles like Windows, Linux & MAC Tutorials, Tips, Tricks, How To fix, Tutorials About Ethical Hacking & Cyber Security Guide, and Software Review. Currently, I have been working as an IT professional since 2018.

Leave a Reply

Your email address will not be published. Required fields are marked *