Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In Debian, there's at least two ways to delete a package:

  • apt-get remove pkgname
  • apt-get purge pkgname

The first preserves system-wide config files (i.e. those found in "/etc"), while the second doesn't.

What is Fedora's equivalent of the second form, purge? Or maybe I should rather ask if yum remove pkgname actually preserves config files.

share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

yum remove is not guaranteed to preserve configuration files.

As stated in the yum HOWTO:

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.

Update

As James points out, you can use the rpm -e command to erase a package but save backup copies of any configuration files that have changed.

For more information, see Using RPM to Erase Packages. In particular:

It checks to see if any of the package's config files have been modified. If so, it saves copies of them.

share|improve this answer
1  
That's not really true, "rpm -e" will remove the configuration files if they haven't changed. If they have been changed they are moved to <filename>.rpmsave and not deleted. –  James Antill Mar 4 '11 at 20:18
add comment

There is no equivalent for "purge", just use yum remove package.

Also you can use yum reinstall package, when you want to reinstall some package...

share|improve this answer
1  
Actually, as explained in Justin Ethier's answer, yum remove is equivalent to apt-get purge. –  Gilles Feb 25 '11 at 20:08
    
@Gilles Justin Ethier says yum remove is "not guaranteed to preserve configuration files." That's not the same as saying that it is guaranteed not to preserve configuration files (which would mean it is equivalent to apt-get purge). Are you making this (much) stronger claim? –  Eliah Kagan Aug 30 '12 at 2:15
    
@EliahKagan That's the way I understand the yum howto that Justin cites. I'm not sure that it's right, the CentOS seems to be saying the opposite. –  Gilles Aug 30 '12 at 2:27
add comment

Your Answer

 
discard

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.