2

Had an issue where 64-bit and 32-bit httpd packages were installed.

When one of the packages is uninstalled via yum remove, it removes certain shared files like /etc/httpd/conf/httpd.conf.

Is there a way to exclude removal of files via either rpm or yum? I looked at both manpages but couldn't see any relevant options.

BTW: I'm aware we could backup the files and reinstate them after the uninstall. I just wanted to know if there's a cleaner, more elegant option.

  • modified config files are usually left after a yum remove but leaving them in all cases might prove difficult. they are part of the package and operate in accordance with the spec file. Basically, it is rpm specific. – Nathan McCoy Jun 10 '15 at 15:34
  • Ah okay. So no way to ignore part of the spec on uninstall? – Belmin Fernandez Jun 10 '15 at 15:38
  • i am not very knowledgeable about creating RPMs. you would probably have to rebuild the RPM, uninstall and reinstall the new RPM after you change the spec. basically too much work... – Nathan McCoy Jun 10 '15 at 15:39
  • @BelminFernandez, regarding config files of the RPM; you can query them with "rpm -qc <package>" to get a list. If the RPM removal is also removing config files, you could query the package ahead of time and copy those files somewhere safe before removing the package. – Jeff Schaller Jun 10 '15 at 17:37
1

It sounds like the package(s) were configured so that the httpd.conf file(s) were not declared to be "config" files. See http://www.rpm.org/max-rpm/s1-rpm-erase-and-config-files.html

1

Sadly (or fortunately, depends how you see it) there's no such thing as selective file removal. What I'd propose is to list the files, the config files marked as such, and the documentation for each package in question and go through the list what you want to keep.

Use

  • rpm -ql packagename for listing the files
  • rpm -qc packagename for listing the config files
  • rpm -qd packagename for listing the documentation files

and go through those lists and manually create backups for files that should be configuration files but are not marked as such (i.e. that appear in rpm -ql output), as pointed out by @Jeff Schaller already.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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