Joined: 16 Apr 2002
|Posted: Wed Nov 20, 2002 9:31 pm Post subject: GF2: xx config files need updating
|Navigation: [Gentoo Fundamentals] [Table of Contents]
Q: I did an "emerge <package-name>", and xx config files need updating. What do I do?
A: Chances are, the output you saw looked something like this:
If we do what we are instructed to (emerge --help config), we then see:
| * Regenerating GNU info directory index...
* Processed 70 info files.
* IMPORTANT: 40 config files in /etc need updating.
* Type emerge --help config to learn how to update config files.
This explains what is going on, so I won't repeat that. Next, we are instructed to use the find command to get a list of what needs updating (find /etc -iname '._cfg????_*'). For example, you might see:
|Config file management support (preliminary)
Portage has a special feature called "config file protection". The purpose of
this feature is to prevent new package installs from clobbering existing
configuration files. By default, config file protection is turned on for /etc
and the KDE configuration dirs; more may be added in the future.
When Portage installs a file into a protected directory tree like /etc, any
existing files will not be overwritten. If a file of the same name already
exists, Portage will change the name of the to-be- installed file from 'foo' to
'._cfg0000_foo'. If '._cfg0000_foo' already exists, this name becomes
'._cfg0001_foo', etc. In this way, existing files are not overwritten,
allowing the administrator to manually merge the new config files and avoid any
In addition to protecting overwritten files, Portage will not delete any files
from a protected directory when a package is unmerged. While this may be a
little bit untidy, it does prevent potentially valuable config files from being
deleted, which is of paramount importance.
Protected directories are set using the CONFIG_PROTECT variable, normally
defined in /etc/make.globals. Directory exceptions to the CONFIG_PROTECTed
directories can be specified using the CONFIG_PROTECT_MASK variable. To find
files that need to be updated in /etc, type:
# find /etc -iname '._cfg????_*'
You can disable this feature by setting CONFIG_PROTECT="-*" in /etc/make.conf.
Then, Portage will mercilessly auto-update your config files. Alternatively,
you can leave Config File Protection on but tell Portage that it can overwrite
files in certain specific /etc subdirectories. For example, if you wanted
Portage to automatically update your rc scripts and your wget configuration,
but didn't want any other changes made without your explicit approval, you'd
add this to /etc/make.conf:
Note: Output will vary depending on your system and the package emerged. For reference, this is only a partial listing after an emerge of baselayout.
|# find /etc -iname '._cfg????_*'
If, I repeat, IF you have not made changes to a file, it is probably safe to update. Two ways of updating the config files are using the "diff" command or the "etc-update" command.
Method using "diff":
/etc/init.d/bootmisc might be a file you haven't changed. Sample ouput if we diff these files:
In this example, the only differences are the "Distributed" and "Header" lines. These particular lines aren't critical, so we can replace the old file with the new file (mv ._cfg0000_bootmisc bootmisc).
|# diff bootmisc ._cfg0000_bootmisc
< # Distributed under the terms of the GNU General Public License, v2 or later
< # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/bootmisc,v 1.22 2002/11/04 14:51:07 azarah Exp $
> # Distributed under the terms of the GNU General Public License v2
> # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/bootmisc,v 1.23 2002/11/18 13:07:02 azarah Exp $
Method using "etc-update":
Post comments on this FAQ to [FAQF] GF2: xx config files need updating.
The media sells it and you live the role.