Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I do yum remove, it sometimes keeps a package's configuration files.

Is there anyway to remove a package completely, without keeping any file that belonged to the package?

I am running CentOS.

share|improve this question
Can you provide an example of configuration files are left after yum remove? – ZaSter Feb 8 '13 at 1:53
~/.mozilla left by firefox, for example – Howard Feb 8 '13 at 5:31
~/.mozilla is created only when you run the firefox program. It is not created by the firefox package. Run the command rpm -qf ~/.mozilla and it will report that that file is not part of any package. – ZaSter Feb 8 '13 at 22:37
@ZaSter : When I removed quagga package it kept all its config files in /etc/quagga (Files like zebra.conf, ospfd.conf, bgpd.conf) which should have been removed along with package itself. If it is by design to keep them, then please provide a command that will also remove the configuration files. – TusharG May 21 '15 at 7:03
@TusharG That's correct. For RPM packages that contain declared configuration files, yum remove does not remove those files. – ZaSter May 22 '15 at 16:41
up vote 5 down vote accepted

Check the Deleting packages with yum section in the HOW TO

There says:

In any event, the command syntax for package removal is:

   # yum remove package1 [package2 package3...]

As noted above, it removes package1 and all packages in the dependency tree that depend on package1, possibly irreversibly as far as configuration data is concerned.

As a quick way you can try:

yum remove package
yum install package

Also here is an interesting for. And the question can help you.

The one that keeps configs in a backup is rpm -e

What you can do is find out what is in a rpm using:

 rpm -ql packagename


rpm -qlp packagename if the package is not yet installed.

then, you can manually make the modifications you want.

Hope this helps!

share|improve this answer
I guess it is probably impossible to remove all files that ever came with a package... but still your recommendation is helpful. – Howard Feb 8 '13 at 21:47
@HowardGuo I did some more research & I found something very usefull too!.. I'll update the anwer and hope it helps – AAlvz Feb 9 '13 at 0:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.