[SOLVED] How to stop config files I deleted from getting re-added after a yum upgrade
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to stop config files I deleted from getting re-added after a yum upgrade
There are some httpd config files in /etc/httpd/conf.d/ that I don't want, such as ssl.conf, so I rename it from ssl.conf to ssl.conf.bak so that it doesn't get read by httpd. But when I do a 'sudo yum upgrade httpd', the file comes back (which seems about right). So if renaming or deleting a file that I don't want doesn't keep it gone after an upgrade, is there any other way to ensure it stays gone, or will I simply have to remember to rename these files again every time I upgrade?
It is the /etc/httpd/conf/httpd.conf file that tells Apache to use conf.d.
What you might want to do is create a new directory e.g. myconf.d to contain only the files you want from httpd.conf then modify the /etc/httpd/conf/httpd.conf to point to myhttpd.conf.d instead of httpd.conf.d. The relevant section in httpd.conf is:
Code:
#
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf
That's a great idea, I'll certainly do that. Out of curiosity, let's say for other packages that aren't httpd and aren't as flexible as this is in their configuration, would there be a way to maybe 'exclude' certain files from the yum upgrade or mark them as deleted? Or would I simply have to remember to delete the files after doing a yum upgrade?
I'm not aware of a way to do it with yum itself. It allows exclude of packages so you could exclude httpd entirely (see "man yum" and "man yum.conf") but not of files so far as I'm aware.
The files installed by yum are RPMs (RedHat Package Manager packages) and there is an exclude for files in rpm (I haven't used it but saw in "man rpm"). So one way to do it might be to download the htttpd package RPM from the repository then use rpm command to install it with the exclude option.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.