LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-02-2006, 09:50 AM   #1
Peter Westlake
LQ Newbie
 
Registered: Oct 2004
Location: UK
Distribution: Debian, SuSE, RedHat
Posts: 7

Rep: Reputation: 0
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?

Thanks,

Peter.
 
Old 02-02-2006, 11:12 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
Old 02-02-2006, 11:31 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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
 
Old 02-02-2006, 11:36 AM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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
 
Old 02-03-2006, 07:06 AM   #5
Peter Westlake
LQ Newbie
 
Registered: Oct 2004
Location: UK
Distribution: Debian, SuSE, RedHat
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for the replies! Tracking diffs with source control is a cunning plan - I'll try it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
edited files wont update in Apache cashton2k Linux - Newbie 1 01-13-2006 09:25 AM
irssi config edited but I didnt edit it _mu_ Linux - Software 1 07-25-2005 07:09 PM
I edited my fstab for ntfs, I can open the drive, but no files xephyr Linux - Newbie 7 10-26-2004 06:06 PM
got nvidia to install and edited xfree86 config but x won't start foustware Linux - Software 5 08-06-2004 05:27 PM
Pinnacle Studio 8 Files - can they be edited by any Linux Tool? Thyriel Linux - Software 0 08-21-2003 03:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration