Actualizar Gentoo

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

Este documento explica cómo las nuevas versiones de Gentoo afectan a instalaciones ya existentes.

It is important to keep Gentoo up to date. In addition to the need to have the latest security patches, Gentoo installations can get too out of sync with the current version and sometimes become complex to update.

Consejo
Update Gentoo Linux between daily and weekly to keep a Gentoo Linux installation running smoothly with the latest security updates. Waiting more than a few weeks to update may make things a little more complicated when the update is attempted. Please don't synchronize more than once daily, to avoid strain on the servers.
Nota
Any instructions that only affect ten or more year old systems will not be retained here. See page history for previous versions.

Gentoo differs from most other Linux distributions when it comes to updates. Most distributions have regular releases, every few months or years, which can be anticipated events for some distributions.

Gentoo, by contrast, is a rolling release distribution. There is no need to wait for a release to come out in order to get the latest version of packages - software can be installed as soon as it becomes stable. Gentoo was designed from the beginning around this concept of fast, incremental updates, and there are frequent updates to Gentoo software, with new and updated packages most days. Further information on Gentoo specifics can be found in the FAQ, about releases and Gentoo and what makes Gentoo different.

Idealmente los usuarios instalaría el software una primera vez y nunca se tendrían que preocupar por nuevas versiones: simplemente seguir las instrucciones de en Una introducción a Portage en el Manual de Gentoo que explica cómo mantener el sistema al día. Aunque esa es la forma con la que normalmente funcionan las cosas, a veces los cambios se hacen en los paquetes base del sistema los cuales requieren de una actualización manual.

In rare cases, changes made to the core system, to certain packages, profile changes, or certain updates of Portage, may require manual intervention during or after an update. A news item will be published in such critical cases and/or will be signaled after a Gentoo repository synchronization. Always read and follow the news items and Portage messages.

Profiles are central to a Gentoo system because they can define core system functionality, and new profiles are made available when there are fundamental changes to the way Gentoo works. A profile is selected at install time, according to the intended use of the system and is usually only changed if necessary, or for an update.

Updating packages

The Handbook has detailed information on updating the Gentoo repository and on updating the system. See man emerge for more detailed information. See repository synchronization for complete information on how to use emaint to synchronize repositories.

Importante
It is important to read and follow any and all news items that may be listed after performing a repository sync.

To update all installed packages to the latest available versions, first update the Gentoo repository with emaint:

root #emaint --auto sync

Or, for short:

root #emaint -a sync

This may output messages that should be read and followed, notably the news items previously mentioned. If config file updates are pending from a previous update, it may remind to update the config files.

Run emerge to update the whole system, with dependencies:

root #emerge --ask --verbose --update --deep --newuse @world

Or, with short options:

root #emerge -avuDN @world

--changed-use may be used in place of --newuse, but only if you do not build binary packages. --changed-use will not trigger reinstallation when disabled USE flags are added or removed from a package. See the Binary package guide.

--with-bdeps=y can be used to update build time dependencies also.

Importante
Pay attention to any information provided by Portage at the end of the update. Some of this information may be available in the Portage log.

If Portage reports dependency issues, sometimes using the --backtrack=30 (or an even higher number) can help. By default, Portage has a relatively low limit on how far it tries to resolve dependencies (for performance reasons), occasionally it is not enough.

Any configuration file changes should be addressed, this can be managed by dispatch-conf:

root #dispatch-conf

Cleaning up after an update

After the update, Portage recommends running emerge --depclean. Be very careful running emerge --depclean, it can remove important packages (e.g. kernel sources or virtual package optional dependencies when an alternative gets merged).

See also
See remove orphaned packages for information on how to use emerge --depclean to remove potentially unused packages safely. See also the Portage FAQ.

Instrucciones para actualizar el perfil

Importante
Asegúrese de que el repositorio principal de Gentoo (el árbol Portage) se ha sincronizado antes de realizar cualquier cambio al perfil.
Advertencia
Read the systemd documentation before changing to a systemd profile.
Importante
Make sure the main Gentoo repository (the Portage tree) has been synced before performing any profile changes.

When a new profile is available, Portage will inform the user with a news item (recent news items are listed on the website).

If a system is too old, it may be non trivial to get the system up to date, it may even be easier to start from scratch.

Generalmente estas migraciones no son obligatorias y los sistemas pueden continuar utilizando el perfil antiguo, simplemente se deben actualizar los paquetes tal y como se explica en el manual de Gentoo.

Cuando la migración a un nuevo perfil es algo aparente, entonces se debe realizar la actualización de forma manual. El modo de actualizar puede variar significativamente entre una versión y otra, depende del nivel de importancia de las modificaciones introducidas en el nuevo perfil.

Exactly what is required to migrate to a new profile is detailed in the relevant news item.

Instrucciones generales

This is a generic outline of what is done to update a profile. As stated previously, specific instructions will be provided in a news item, for each new profile. A profile update often requires manual intervention, beyond just switching the profile version.

Nota
Existen subperfiles desktop y server para la mayoría de arquitecturas. Examine estos perfiles con cuidado ya que pueden servir mejor a los requerimientos que los perfiles por defecto que son extremadamente mínimos.
Nota
El subperfil de desarrollador está específicamente pensado para labores de desarrollo de Gentoo Linux. No tiene como objetivo configurar entornos generales de desarrollo.

Switch profiles with eselect

Make sure warnings in parent section have been read.

En primer lugar, lanzar emerge eselect. La utilidad eselect permite ver y seleccionar perfiles de forma sencilla, sin necesidad de crear o eliminar manualmente enlaces simbólicos.

root #eselect profile list
root #eselect profile set <número>

Switch profiles manually

Make sure warnings in parent section have been read.

De todos modos es posible cambiar los perfiles manualmente:

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

Updating to 17.1 profile

See the appropriate news item. At this point all installations should already be using the 17.1 profile, and migration could be difficult.

Updating to 17.0 profile

See the appropriate news item. At this point all installations should be using the 17.1 profile, and migration could be difficult.

Actualizar sistemas antiguos

Sometimes, systems are too old to easily upgrade. It may be possible to manually update a very old system, but it may be better to start from scratch and copy system configuration an files from the old system to the new one.

Here is a rough guide to updating an old system. Another method can be found here.

La idea de la actualización

La idea del enfoque de esta actualización es que vamos a crear una jaula chroot intermedia de construcción en la que extraeremos un stage3 reciente. A continuación, utilizando las herramientas disponibles en la jaula del stage3, actualizaremos los paquetes del sistema vivo.

Advertencia
Las órdenes descritas abajo pueden ser incompletas y deben servir más como guía que como instrucciones de trabajo. A menos que el enfoque esté claro, podría resultar más rápido hacer una copia de respaldo de los ficheros y reinstalar Gentoo.

Preparar la jaula chroot intermedia para la construcción

En primer lugar creamos la localización de la jaula intermedia de construcción, digamos /mnt/build y extraemos un archivo stage3 reciente en ella.

root #mkdir -p /mnt/build
root #tar -xf /ruta/a/stage3-arquitectura-fecha.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

A continuación creamos un punto de montaje dentro de este entorno chroot, en el cual montaremos el entorno vivo (antiguo) con la opción bind.

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

Ahora también se puede acceder al sistema vivo (antiguo) a través de /mnt/build/mnt/host. Esto nos permitirá acceder al sistema vivo (antiguo) y actualizar los paquetes incluso cuando están dentro de la jaula chroot intermedia de construcción.

Red, chroot y actualización

La nueva instalación necesita acceder a la red, por lo tanto, copie la información relacionada a través de la red:

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

Ahora entramos en la jaula chroot a la localización intermedia de construcción y comenzamos a actualizar paquetes capitales en el sistema vivo hasta que podamos continuar con la actualización del sistema vivo desde el propio sistema (en lugar de hacerlo a través de la jaula chroot intermedia de construcción):

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

It may be a good idea to check that the profile and Portage configuration are compatible between the (old) live system and the chroot.

Ahora comience a construir paquetes en el sistema vivo (anterior). Si Portage es demasiado antiguo o no existe, es una buena idea comenzar por él:

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

Mantenga abierta esta sesión enjaulada e intente actualizar el sistema vivo (anterior). Cuando obtenga fallos en la construcción, podrá utilizar esta sesión chroot para actualizar los paquetes utilizando las herramientas de construcción disponibles en la jaula intermedia de construcción (la cual incluye versiones recientes de sys-libs/glibc, sys-devel/gcc, etc.). Se pueden añadir herramientas a la jaula de construcción si es necesario.

Importante
¡No olvide añadir --root=/mnt/host --config-root=/mnt/host a todas las órdenes emerge lanzadas dentro de la jaula chroot! De lo contrario es la propia jaula chroot la que se actualizará en lugar del (antiguo) sistema vivo.

En algunas instalaciones puede que sea necesario actualizar los ficheros de configuración para instalar nuevo software. Hacer los cambios en el entorno chroot.

Para tener el sistema completamente actualizado antes de salir del raíz, construir el conjuto @world (todos los paquetes) dentro de (antiguo) sistema vivo:

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

Una vez finalizado, el sistema debería estar actualizado.

See also

External resources


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.