Which config files can be edited without clashing with package managers?
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.
Which config files can be edited without clashing with package managers?
When package managers like APT and RPM install or update a package, they often edit configuration files in /etc and other places. How can I tell which files I can edit and which should be left to the package manager?
For instance, on Debian, I can edit my X config file, but I have to be careful not to run dpkg-configure or all my changes are lost. So what happens if a new version of X.org comes out, which needs to alter the format of xorg.conf?
And I have a SuSE setup on which I have been editing the SSH configuration freely - might I lose my changes if SSH is upgraded to a new version?
Are there any general principles, or is each package different?
For RPM packages config files should have "%config(noreplace)" set in the .spec file which means they will save the config as "config.rpmnew" or alike. Unfortunately there is no easy way to check for this when upgrading a package. I keep aproximately ninety percent of configs in a versioning system so it's easy to revert back in case of unwanted changes. A way could be to list the contents of the rpm and backup the config files. You probably don't even need to do that, because you make backups, do you?.. Next to that a lot of packages (lynx, pine, fetchmail etc, etc) first search in the users home for configs before looking in the systemwide config dirs. This way you can easily override systemwide settings. RPM packages don't touch user configs.
I always keep backups of everything I edit. So if the file does get replaced, or I want to revert back to a previous version, it's a simple thing to do. It's just me as root on this system, and no concurrent editing of config files with other users, so I use the simpler RCS rather than CVS.
e.g.,
Code:
# cd /etc/X11
# mkdir RCS
# ci -i -u xorg.conf
# co -l xorg.conf
# vi xorg.conf
# ci -u xorg.conf
p.s., the above "mkdir RCS" and "ci -i -u <filename>" are only required for your initial editing. Once you've put the thing under RCS control subsequent edits are simply:
Code:
# co -l xorg.conf
# vi xorg.conf
# ci -u xorg.conf
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.