This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Aggiornare Gentoo

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Upgrading Gentoo and the translation is 34% complete.
Outdated translations are marked like this.

Questo documento spiega come i nuovi rilasci di Gentoo influenzino le installazioni preesistenti.

Aggiornamenti

Filosofia

Qui nella terra di Gentoo, il concetto di aggiornamento è piuttosto diverso se confrontato con il resto del mondo Linux. È un fatto ben noto che Gentoo non sia in contatto con la maniera "classica" di aggiornare il software: attendere un nuovo rilascio, scaricarlo, masterizzarlo, mettere il CD nel lettore e poi seguire le istruzioni per l'aggiornamento.

Gli utenti di Gentoo tuttavia sanno che questo processo è estremamente frustrante per gli utenti esperti che vogliono avere software all'avanguardia. Anche gli utenti esperti di altre distribuzioni probabilmente condividono lo stesso pensiero, data la popolarità e la diffusione di strumenti come apt o apt-rm che danno la possibilità di avere aggiornamenti veloci e frequenti. Tuttavia, nessuna distribuzione è più adatta di Gentoo per soddisfare questo tipo di utenti esigenti. Sin dall'inizio, Gentoo è stato progettato basandosi sul concetto di aggiornamenti rapidi e incrementali.

Idealmente, gli utenti installano il software una volta sola e non si preoccupano dei rilasci: basta seguire le istruzioni nell'Introduzione a Portage nel Manuale di Gentoo che spiegano come mantenere aggiornato il sistema. Questo è come vanno le cose di solito; talvolta però, vengono fatti dei cambiamenti al sistema di base tali da dover richiedere aggiornamenti manuali.

Rilasci e profili

Una domanda ricorrente circa il processo di rilascio di Gentoo è: "Perché lanciare rilasci frequenti, se poi non si lascia aggiornare il software agli utenti?" Ci sono varie ragioni:

  • Un nuovo rilascio comporta nuovi CD di installazione con correzione di errori e nuove funzionalità
  • Un nuovo rilascio fornisce un insieme aggiornato di pacchetti GRP, quindi gli utenti che scelgono la maniera veloce per l'installazione (stage3 + pacchetti precompilati) si ritrovano con un sistema che non è obsoleto
  • Infine, un nuovo rilascio può, di tanto in tanto, implementare alcune funzionalità che sono incompatibili con i rilasci precedenti

Quando un rilascio include nuove funzionalità incompatibili oppure fornisce un insieme di pacchetti ed impostazioni di base che modificano profondamente il comportamento del sistema, si dice che fornisce un nuovo profilo.

Un profilo è un insieme di file di configurazione, memorizzati in una sotto cartella di /usr/portage/profiles, che descrivono cose come le ebuild che vengono considerate pacchetti di sistema, le opzioni USE predefinite, la mappatura predefinita per i pacchetti virtuali, e l'architettura sulla quale sta girando il sistema.

Il profilo in uso viene determinato dal collegamento simbolico /etc/portage/make.profile, che punta ad una sotto cartella di /usr/portage/profiles che contiene i file del profilo. Per esempio, il profilo predefinito x86 13.0 può essere trovato in /usr/portage/profiles/default/linux/x86/13.0. I file nelle cartelle superiori sono anch'essi parte del profilo (e sono di conseguenza condivisi da diversi sotto profili). Per questo vengono chiamati profili a cascata.

I profili resi obsoleti dai nuovi sono salvati in /usr/portage/profiles assieme a quelli attuali, ma sono marcati come deprecati. Quando accade ciò, viene messo nella directory del profilo un file chiamato deprecated. Questo file contiene il nome del profilo "a cui dovrebbe essere aggiornato"; Portage usa questa informazione per notificare automaticamente gli amministratori di effettuare l'aggiornamento ad un nuovo profilo.

Un nuovo profilo può essere creato per varie ragioni: il rilascio di nuove versioni dei pacchetti essenziali (come sys-apps/baselayout, sys-devel/gcc, o sys-libs/glibc) che sono incompatibili con le versioni precedenti, un cambiamanto nelle USE flag predefinite o nelle mappature virtuali, o magari un cambiamento delle impostazioni a livello di sistema.

Tenersi aggiornati con i nuovi rilasci

Rilasci senza cambiamenti del profilo

If a new Gentoo release does not include a new profile then just pretend that it never happened. :)

Quando i pacchetti installati sono aggiornati come spiegato nel Manuale di Gentoo, allora il sistema sarà esattamente lo stesso che si ottiene quando lo si installa usando il nuovo rilascio.

Rilasci con cambiamenti del profilo

Se un rilascio (come il 13.0 per x86) introduce un nuovo profilo, allora è possibile scegliere di migrare al nuovo profilo.

Generalmente, tali migrazioni non sono obbligatorie, e i sistemi possono continuare ad utilizzare il vecchio profilo - è sufficiente aggiornare i pacchetti come spiegato nel Manuale di Gentoo.

Tuttavia, Gentoo raccomanda fortemente di aggiornare il profilo se esso diventa deprecato. Quando accade ciò, significa che gli sviluppatori di Gentoo non lo supporteranno più.

Quando una migrazione del profilo è evidente, l'aggiornamento deve essere eseguito manualmente. La maniera in cui si aggiorna può variare significativamente da rilascio a rilascio; dipende da quanto sono profonde le modifiche introdotte nei nuovi profili.

Nel caso più semplice gli utenti devono solo cambiare il collegamento simbolico /etc/portage/make.profile, nel caso peggiore possono dover ricompilare l'intero sistema da zero effettuando una danza voodoo corretta. La migrazione è solitamente spiegata nelle note di rilascio. Le istruzioni necessarie sono ulteriormente spiegate in questa guida.

Profili supportati

Per visualizzare la lista dei profili supportati, eseguire eselect (che può essere installato usando emerge eselect) come di seguito:

root #eselect profile list

Aggiornamento da sistemi più vecchi

Alcuni sistemi sono troppo vecchi per poterne semplicemente cambiare il profilo. I profili più recenti possono aver bisogno di versioni di Portage più recenti o di altro software che non può più essere installato perché le definizioni del pacchetto (ebuild) per le versioni di questi software più vecchi non sono più disponibili.

Se ci si trova in questo caso, il sistema deve prima ricevere delle immagini (snapshot) più vecchie dell'albero di Portage ed aggiornare almeno Portage (ma preferibilmente tutti i pacchetti dell'insieme di sistema), accrescendo gradualmente la data dell'immagine dell'albero di Portage finché non è abbastanza recente da poter seguire nuovamente le istruzioni per la migrazione del profilo:

root #mv /usr/portage /usr/portage.latest
root #tar xjpf /percorso/di/portage-20090720.tar.bz2 -C /usr
root #emerge -u portage

Le immagini più vecchie sono spesso ancora disponibili su alcuni mirror in internet oppure in luoghi specifici dedicati a questo scopo. Si raccomanda di verificare l'integrità di questi file per assicurarsi che non siano stati manomessi:

root #gpg --verify portage-20090720.tar.bz2.gpgsig portage-20090720.tar.bz2

Benché le chiavi di firma di rilascio possano essere scadute, la firma dovrebbe essere ancora corretta.

Aggiornamento da sistemi (troppo) vecchi

Talvolta, i sistemi sono troppo vecchi perché si possano aggiornare semplicemente. Il percorso di aggiornamento potrebbe aver bisogno di versioni intermedie del software (come portage) che non esiste più, richiedendo di aggiornare l'albero di portage in piccoli passi (per esempio aggiornamenti dell'albero incrementali con passi di 3 o 4 mesi).

Per aggiornare tali sistemi, uno stage3 recente può essere usato per aggiornare il sistema. Le istruzioni per ciò sono presenti nella sezione Aggiornamento dei vecchi sistemi.

Istruzioni di aggiornamento del profilo

Istruzioni generali

Importante
Assicurarsi che il repository principale di Gentoo (l'albero di Portage) sia sincronizzato prima di effettuare qualunque cambiamento del profilo.

First, run emerge eselect. The eselect utility makes viewing and selecting profiles easy, without needing to create or remove symlinks by hand.

root #eselect profile list
root #eselect profile set <number>

Changing profiles manually is still supported though:

root #rm /etc/portage/make.profile
root #cd /etc/portage
root #ln -s ../../usr/portage/profiles/<selected profile> make.profile
Note
There are desktop and server subprofiles for most architectures. Examine these profiles carefully, as they may serve the requirements better than the extremely minimal default profiles.
Note
The developer subprofile is specifically for Gentoo Linux development tasks. It is not meant to help set up general development environments.

Updating to 2008.0, 2007.0, or 2006.1

Be aware that, if an upgrade from these profiles is selected, that they expect the system to be set to a Unicode locale by default; specifically that UNICODE="yes" is set in /etc/rc.conf. For this to work, a Unicode locale for the system must be created. Please read the UTF-8 article to learn how to create the proper locale.

Alternatively, if setting a locale is not preferred, then users need to specify UNICODE="no" in /etc/rc.conf, and re-emerge sys-apps/baselayout (or wait until the next baselayout update) with the -unicode USE flag. This can be accomplished through:


root #echo "sys-apps/baselayout -unicode" >> /etc/portage/package.use
root #emerge --ask sys-apps/baselayout
  • or setting it globally for all packages by adding it to the USE variable in /etc/portage/make.conf:
FILE /etc/portage/make.confDisable Unicode support globally
USE="-unicode"
root #emerge --ask sys-apps/baselayout
Note
Users updating to a 2007.0 profile on the SPARC architecture will need to follow the GCC Upgrading Guide, as gcc-4 is the default compiler.

Finally, follow the general upgrade instructions for updating the profile.

Updating to 2006.0

To switch to the 2006.0 profile, point the /etc/portage/make.profile symlink to the new location. Make sure Portage is updated before changing the profile.

root #rm /etc/portage/make.profile
root #ln -s ../usr/portage/profiles/<selected profile> /etc/portage/make.profile

alpha - Users that use a 2.4 kernel or don't want to use NPTL should use the default-linux/alpha/no-nptl profile. More information is available in the alpha release notes.

ppc - The merge of the ppc32 and ppc64 profiles went forward. The ppc32 profile has been changed in a way that offers a minimalistic generic profile for all purposes, located in default-linux/ppc/ppc32. The release-dependent profile is optimized for desktop-usage and located in default-linux/ppc/ppc32/2006.0. There are some subprofiles available for G3 and G4 processors, and G3/Pegasos and G4/Pegasos for the Pegasos Open Desktop Workstation. Make sure to choose the correct subprofile for the system when migrating to a 2006.0 profile.

sparc - Upgrading to the 2.4 -kernel based 2006.0/2.4 profile requires manual user intervention (unmerging Java stuff) and an emerge -e @world because of the GCC upgrade. Upgrading to the 2.6 -kernel based 2006.0 profile which is not considered stable also requires an entry in /etc/portage/package.unmask to unmask a 2.6 version of sys-kernel/gentoo-sources and a full rebuild.

All other archs - There are no fundamental changes in this profile. No specific action needs to be performed.

Updating to 2005.1

To switch to the 2005.1 profile, point the /etc/portage/make.profile symlink to the new location. Make sure Portage is updated before changing the profile.

root #rm /etc/portage/make.profile
root #ln -s ../usr/portage/profiles/<selected profile> /etc/portage/make.profile

All archs - There are no fundamental changes in this profile. No specific action needs to be performed.

ppc - With the 2005.1 release, the ppc and ppc64 profiles were merged and a number of subprofiles for specific subarchitectures were created. Make sure to choose the correct subprofile for the system when migrating to a 2005.1 profile.

Updating to 2005.0

With the introduction of 2005.0, several architectures have decided to define additional profiles. Make sure to read the description of said profiles before deciding to migrate to one of them. Most architectures now also default to the 2.6 kernel tree where 2.4 was chosen previously.

Some architectures require a bit more actions to be completed in order to convert from one profile to another. If that is the case, the step-by-step guides are linked from the table.

Profile Description Specific upgrade guide
default-linux/alpha/2005.0 Default Alpha 2005.0 profile for 2.6 kernels
default-linux/alpha/2005.0/2.4 Alpha 2005.0 profile for 2.4 kernels
default-linux/amd64/2005.0 Default AMD64 2005.0 profile for 2.6 kernels
default-linux/amd64/2005.0/no-multilib AMD64 2005.0 profile for multilib-disabled system installations
default-linux/arm/2005.0 Default ARM 2005.0 profile for 2.6 kernels
default-linux/hppa/2005.0 Default HPPA 2005.0 profile for 2.6 kernels
default-linux/hppa/2005.0/2.4 HPPA 2005.0 profile for 2.4 kernels
default-linux/mips/2005.0 Default MIPS 2005.0 profile
default-linux/mips/cobalt/2005.0 Cobalt specific MIPS 2005.0 profile
default-linux/mips/mips64/n32/2005.0 2005.0 profile for n32-supporting MIPS platforms
default-linux/mips/mips64/ip28/2005.0 Indigo2 Impact specific 64-bit 2005.0 profile
default-linux/mips/mips64/2005.0 64-bit MIPS 2005.0 profile
default-linux/ppc/2005.0 Default PPC 2005.0 profile for 2.6 kernels
default-linux/ppc64/2005.0 Default PPC64 2005.0 profile for 2.6 kernels
default-linux/s390/2005.0 Default S390 2005.0 profile
default-linux/sparc/sparc32/2005.0 Default SPARC 32-bit 2005.0 profile
default-linux/sparc/sparc64/2005.0 Default SPARC 64-bit 2005.0 profile
default-linux/x86/2005.0 Default x86 2005.0 profile for 2.6 kernels
default-linux/x86/2005.0/2.4 x86 2005.0 profile for 2.4 kernels

To switch to the selected profile, point the /etc/portage/make.profile symlink to the new location. Make sure Portage is updated before changing the profile!

root #rm /etc/portage/make.profile
root #ln -s ../usr/portage/profiles/<selected profile> /etc/portage/make.profile

When an upgrade is planned from a Linux 2.4-based system to a 2.6 kernel, make sure to read our Gentoo Linux 2.6 Migration Guide.

Updating to 2004.3

With the introduction of the 2004.3 profiles, users are not going to see huge modifications of their systems (see below for details). However, Gentoo developers decided to push out this new profile and to deprecate quite a few of the old ones to speed up the adoption of stacked profiles, that is, the profiles that follow the new layout of the /usr/portage/profiles directory, for instance /usr/portage/profiles/default-linux/x86/2004.3 (supported by Portage 2.0.51 or later).

To switch to the 2004.3 profile, point the /etc/portage/make.profile symlink to the new location:

Warning
Don't forget to upgrade Portage before changing the profile!
root #rm /etc/portage/make.profile
root #ln -s ../usr/portage/profiles/default-linux/<arch>/2004.3 /etc/portage/make.profile

All archs - As said above, there are no big changes introduced in this profile. However, it should be noted that sys-apps/slocate (deprecated) and net-misc/dhcpcd are no longer considered system packages. This means that during a emerge --depclean, Portage will try to remove them from the system. If any of those packages are needed, add them to /var/lib/portage/world after the profile switch, or manually emerge them.

ppc - sys-fs/udev is now the default instead of sys-fs/devfs (deprecated) for newly installed machines. This has no effect on already installed machines, though.

Updating Portage to support cascading profiles

Although this section does not seem to integrate well in this upgrading guide, it is quite important. Any profile listed above this section requires a Portage version that supports cascading profiles. However, some obsoleted profiles don't allow the user to upgrade Portage or the user is using a profile that isn't available anymore - any attempt to upgrade Portage will result in a failure.

To work around this problem, users can set a temporary symbolic link to the obsolete profile, allowing them to upgrade their Portage after which they can continue with the upgrade procedure set forth in this guide. Please substitute <arch> with the respective system architecture:

root #rm /etc/portage/make.profile
root #cd /etc/portage
root #ln -sf ../usr/portage/profiles/obsolete/<arch> make.profile
root #emerge -n '>=sys-apps/portage-2.0.51'

Updating to 2004.2

To switch to the 2004.2 profile, point the /etc/portage/make.profile symlink to the new location:

Warning
Don't forget to upgrade Portage before changing the profile!
root #rm /etc/portage/make.profile
root #ln -s ../usr/portage/profiles/default-linux/<arch>/2004.2 /etc/portage/make.profile

x86 - This profile changes the default X11 implementation from x11-base/xfree (deprecated) to x11-base/xorg-x11. This change only touches the default value, and is only relevant for those who have not installed an X server yet. If one is already installed, then it will not affect the system at all; users are free to switch from one X server to the other exactly as before.

amd64 - There are no fundamental changes from previous profiles, no specific action needs to be performed.

Updating to 2004.0

To switch to the 2004.0 profile, point the /etc/portage/make.profile symlink to the new location:

root #rm /etc/portage/make.profile
root #ln -s ../usr/portage/profiles/default-<arch>-2004.0 /etc/portage/make.profile

All archs - There are no fundamental changes from previous profiles, no specific action needs to be performed.

Updating from profiles older than 1.4 to 1.4

The instructions for this upgrade are quite complex, and can be found here.

Updating old systems

Idea of the upgrade

The idea with this upgrade approach is that we create an intermediate build chroot in which a recent stage3 is extracted. Then, using the tools available in the stage3 chroot we upgrade the packages on the live system.

Warning
The commands below might be incomplete and serve more as a guidance rather than work instructions. Unless the approach is clear, it might be faster to just backup the important files and re-install Gentoo.

Preparing the intermediate build chroot

Let's first create the intermediate build chroot location, say /mnt/build, and extract a recent stage3 archive into it.

root #mkdir -p /mnt/build
root #tar -xf /path/to/stage3-somearch-somedate.tar.bz2 -C /mnt/build
root #mount --rbind /dev /mnt/build/dev
root #mount --rbind /proc /mnt/build/proc
root #mount --rbind /sys /mnt/build/sys

Next, we create a mount point inside this chroot environment, on which we then bind-mount the live (old) environment.

root #mkdir -p /mnt/build/mnt/host
root #mount --rbind / /mnt/build/mnt/host

So now the live (old) system is also reachable within /mnt/build/mnt/host. This will allow us to reach the live (old) system and update the packages even when chrooted inside the intermediate build chroot.

Network, chroot, and update

The new install needs to access the network, so copy over the network related information:

root #cp -L /etc/resolv.conf /mnt/build/etc/

Now chroot into the intermediate build location, and start updating vital packages on the live system, until the live system can be updated from within the live system (rather than through the intermediate build chroot):

root #chroot /mnt/build
root #source /etc/profile
root #export PS1="(chroot) ${PS1}"
(chroot) root #emerge --sync


Now start building packages into the (old) live system. If Portage is old or missing, it is a good idea to start with that:

(chroot) root #emerge --root=/mnt/host --config-root=/mnt/host --verbose --oneshot sys-apps/portage

Keep this chrooted session open and try to update the (old) live system. When failures occur, use this chrooted session to update packages using the build tools available in the intermediate build chroot (which includes recent sys-libs/glibc, sys-devel/gcc, etc.). Tools can be added as needed to the build chroot.

Important
Do not forget to add --root=/mnt/host --config-root=/mnt/host to all emerge commands executed within the chroot! Otherwise the chroot itself is updated rather than the (old) live system.

For some installations it may be necessary to update configuration files in order to install new software. Make the changes in the chroot environment.

To get the system fully up-to-date before exiting the root, build the @world set (all packages) into the (old) live system:

(chroot) root #emerge --root=/mnt/host --config-root=/mnt/host --update --newuse --deep --ask @world

Once finished the system should now be up to date!


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Gregorio Guidi, Chris Gianelloni, Joshua Saddler
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.