Ho dato "emerge < pacchetto-nome >", e alla fine ho ricevuto l'output: "xx config files need updating" Cosa faccio?
Le possibilità sono: l'output che avete visto avete visto è come questo:
Code: Select all
* 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.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
unexpected changes.
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:
CONFIG_PROTECT_MASK="/etc/wget /etc/rc.d"
Questo mostra cosa di andrà a cambiare, non lo ripeterò dopo. Quindi, sappiamo usare il comando find per avere una lista di cosa necessita di essere aggiornata (find /etc -iname '._cfg????_*'). Per esempio, potreste vedere:
Code: Select all
# find /etc -iname '._cfg????_*'
/etc/conf.d/._cfg0000_net
/etc/init.d/._cfg0000_clock
/etc/init.d/._cfg0000_bootmisc
/etc/init.d/._cfg0000_checkfs
/etc/skel/._cfg0000_.bash_profile
/etc/skel/._cfg0000_.bashrc
/etc/._cfg0000_fstab
/etc/._cfg0000_hosts
/etc/._cfg0000_modules.autoloadSe, e ripeto, SE non avete fatto cambiamenti ad un file, è probabilmente più sicuro aggiornare. Ci sono due modi per aggionare i file di configurazione, e sono: il comando "diff" o il comando "etc-update".
Aggiornare con "diff":
/etc/init.d/bootmisc potrebbe essere un file che non ha subito cambiamenti. Questo è l'ouput se diamo il diff di questi files:
Code: Select all
# diff bootmisc ._cfg0000_bootmisc
3,4c3,4
< # 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 $Aggiornare con "etc-update":
Scrivete il comando
Code: Select all
etc-updateCode: Select all
Scanning Configuration files...
Automerging trivial changes in: sample-tls.cf
Automerging trivial changes in: transport
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/ffserver.conf
/etc/._cfg0000_ffserver.conf
2) /etc/apache2/conf/modules.d/70_mod_php.conf
/etc/apache2/conf/modules.d/._cfg0000_70_mod_php.conf
3) /etc/conf.d/hdparm
/etc/conf.d/._cfg0000_hdparm
4) /etc/php/cli-php4/php.ini
/etc/php/cli-php4/._cfg0000_php.ini
5) /etc/postfix/main.cf
/etc/postfix/._cfg0000_main.cf
6) /etc/postfix/postfix-script
/etc/postfix/._cfg0000_postfix-script
7) /etc/postfix/sample/sample-ipv6.cf
/etc/postfix/sample/._cfg0000_sample-ipv6.cf
8) /etc/sound/events/gnomemeeting.soundlist
/etc/sound/events/._cfg0000_gnomemeeting.soundlist
Please select a file to edit by entering the corresponding number.
(-1 to exit) (-3 to auto merge all remaining files)
(-5 to auto-merge AND not use 'mv -i'): Code: Select all
Showing differences between /etc/postfix/main.cf and /etc/postfix/._cfg0000_main.cf
--- /etc/postfix/main.cf 2003-06-21 02:27:20.000000000 -0700
+++ /etc/postfix/._cfg0000_main.cf 2003-06-30 06:47:17.000000000 -0700
@@ -206,8 +206,8 @@
# with 450 (try again later) until you are certain that your
# local_recipient_maps settings are OK.
#
-unknown_local_recipient_reject_code = 550
-#unknown_local_recipient_reject_code = 450
+#unknown_local_recipient_reject_code = 550
+unknown_local_recipient_reject_code = 450
# "Maildir/" for qmail-style delivery (the / is required).
#
#home_mailbox = Mailbox
-#home_mailbox = .maildir/
+home_mailbox = .maildir/
+home_mailbox = .maildir/
# The mail_spool_directory parameter specifies the directory where
# UNIX-style mailboxes are kept. The default setting depends on the
# system type.
#
-mail_spool_directory = /var/mail
+#mail_spool_directory = /var/mail
#mail_spool_directory = /var/spool/mail
# The mailbox_command parameter specifies the optional external
@@ -635,4 +635,4 @@
# readme_directory: The location of the Postfix README files.
#
-readme_directory = /usr/share/doc/postfix-2.0.12-r1
+readme_directory = /usr/share/doc/postfix-2.0.131) Replace original with update
2) Delete update, keeping original as is
3) Interactively merge original with update
4) Show differences again
Please select from the menu above (-1 to ignore this update): Questo e' lo stesso output che abbiamo utilizzando il comando "diff", ma abbiamo a disposizione diverse opzioni:
Code: Select all
1) Sovrascrivere il file originale con l'aggiornamento
2) Rimuovere l'aggiornamento e mantenere l'originale
3) Creare interattivamente un nuovo file unendo l'originale con l'aggiornamento
4) Mostrare nuovamente le differenze
-1 Ignorare questo aggiornamentoCode: Select all
1) Se l'aggiornamento sembra abbastanza insignificante, avanti e sovrascrivi l'originale.
2) Se l'aggiornamento non e' necessario, mantieni l'originale
3) Osservare i cambiamenti e scegliere i cambiamenti da tenere. Questa e' l'opzione che offre maggior flessibilita'
4) Mostrare le differenze fra i due fileQua e' l'opzione in azione:
Code: Select all
/etc/postfix/._cfg0000_main.cf /etc/postfix/main.cf /etc/postfix/main.cf.merged
Merging /etc/postfix/._cfg0000_main.cf and /etc/postfix/main.cf
unknown_local_recipient_reject_code = 550 | #unknown_local_recipient_reject_code = 550
#unknown_local_recipient_reject_code = 450 | unknown_local_recipient_reject_code = 450 Il file visualizzato ha sulla sinistra l'originale e a destra la nuova configurazione. In questo particolare caso, il cambiamento fatto alla configurazione deve rimanere cosi'. Premendo "l" manterra' la modifica.
Code: Select all
%l
#home_mailbox = .maildir/ | home_mailbox = .maildir/
> home_mailbox = .maildir/Code: Select all
%l
readme_directory = /usr/share/doc/postfix-2.0.12-r1 | readme_directory = /usr/share/doc/postfix-2.0.13Code: Select all
%r
1) Replace /etc/postfix/main.cf with merged file
2) Show differences between merged file and original
3) Remerge original with update
4) Return to the previous menu
Please select from the menu above (-1 to exit, losing this merge):A questo punto, e' stato generato un file temporaneo che contiene i dati originali e quelli che si sono scelti di cambiare.
Queste quattro opzioni fanno quanto segue:
1) Sovrascivere il file originale con quello temporaneo creato da noi con i passi precedenti
2) Visualizzare le differenze tra il file originale e quello creato da noi.
3) Iniziare il processo di merging con il file creato e quello originale.
4) Non fare cambiamenti e ritornare alla lista dei file da aggiornare.
Selezionando l'opzione q per sostituire il file di configurazione originale otteniamo:
Code: Select all
Replacing /etc/postfix/main.cf with /etc/postfix/main.cf.merged
mv: overwrite `/etc/postfix/main.cf'?
rm: remove regular file `/etc/postfix/._cfg0000_main.cf'?Dopo la conferma dell'aggiornamento ritornerete alla lista dei file da aggiornare (con l'esclusione di quelli che abbiamo gia' aggiornato):
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
Code: Select all
1) /etc/ffserver.conf
/etc/._cfg0000_ffserver.conf
2) /etc/apache2/conf/modules.d/70_mod_php.conf
/etc/apache2/conf/modules.d/._cfg0000_70_mod_php.conf
3) /etc/conf.d/hdparm
/etc/conf.d/._cfg0000_hdparm
4) /etc/php/cli-php4/php.ini
/etc/php/cli-php4/._cfg0000_php.ini6) /etc/postfix/postfix-script
/etc/postfix/._cfg0000_postfix-script
7) /etc/postfix/sample/sample-ipv6.cf
/etc/postfix/sample/._cfg0000_sample-ipv6.cf
8) /etc/sound/events/gnomemeeting.soundlist
/etc/sound/events/._cfg0000_gnomemeeting.soundlist
Please select a file to edit by entering the corresponding number.
(-1 to exit) (-3 to auto merge all remaining files)
(-5 to auto-merge AND not use 'mv -i'):Code: Select all
Exiting: Nothing left to do; exiting. :)Autore prima parte: pjp (testo originale)
Autore (etc-update): papabean (testo originale)
Traduttore prima parte: GianX
Traduttore (etc-update): fedeliallalinea

