
Do you understand the difference between apt remove and apt purge better now? Which one do you prefer to use? Learn more on apt commands and package managementīoth of these remove and purge options are a couple of options of the apt command. In both cases, you’ll have to remove the remaining configuration files from the user’s home directory and run apt autoremove to eliminate any leftover dependencies.

Use apt purge when you have to get rid of the custom configuration files. In my opinion, apt remove is what you should use most of the time. So, should you use apt remove or apt purge?įew people just get addicted to using apt purge.

So there seems to be a mechanism that protects against such wild card expansions. The espeak* should expand to espeak-ng as well.īut when espeak was pruged, the `espeak-ng package was untouched. I installed espeak and espeak-ng packages. I didn’t find a definite answer on this point in the documentation (i.e. This indicates that it will remove all the packages with names starting from package-name. When you purge a package, you’ll notice that it mentions removing package-name*. Does apt purge perform a wild-card removal? If you configured an application in a bad way and want to start from scratch, the apt purge command is the way to go forward. The apt remove command allows you to reuse an application with a similar configuration that you used in the past. Since the application configuration files are not touched, you are logged back in without additional effort.
#SUDO APT UNINSTALL INSTALL#
You remove the current version and install the newer one (even if you don’t see this process). Surprising, no?īut this is a feature because some applications like Discord, VirtualBox provide you updates similarly. Now if you start Discord, you’ll notice that you are already logged into your account. Remove Discord and install it again using deb file. Start using it by logging into your account. You install Discord on Ubuntu with deb file. The effect of using apt remove or apt purgeĪ practical example I can think of is Discord. Those files are really small in size and hardly take up disk space.ĭo note that not all applications create configuration files under /etc or home directory. They remain in the system unless you manually remove them. The apt commands do not touch the configuration files in the home directory. Files remaining after purging mplayerĪs you can see, the files from /etc directory no longer exist.īut what about the files in the home directory? Should apt purge not remove it? Let’s look for files associated mplayer now. Using apt purge command to remove mplayer Now, if I install mplayer again and use apt purge to remove the mplayer application this time. Here are the files that remain in the system: Files remaining after mplayer removalĪs you can see, there are mplayer files remaining in two locations: /etc and /home/abhishek. Here are the files associated with MPlayer before removal. The focus is on seeing what files remain after each operation. Let me share a practical example of removing the mplayer application using both apt remove and apt purge commands. See what’s being removed and what remains Have you ever removed an application and installed it again, only to notice that all your settings are in place? It’s because the apt remove command doesn’t remove the configuration files. Neither command touches the application files under the home directory of the user.

That’s the only difference between the two. The apt-purge removes the package and purges any configuration files associated with it. What’s the difference between apt-remove and apt-purge?īoth apt-remove and apt-purge do the same thing and that is to uninstall a package. So, why are there two similar commands for removing packages? What’s the difference between the two? Let me explain it to you with a few examples. This leaves you confused because using apt purge is quite similar to apt remove: sudo apt purge package_name To uninstall an application in the Ubuntu terminal, you can use: sudo apt remove package_nameīut in various forums, you may come across the suggestion to use the apt purge command for removing applications completely.
