What is Fedora's equivalent of 'apt-get purge'?

  • 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.

  • 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.

    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 .rpmsave and not deleted.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM