HowTo:gentoo:Portage

De Luispa

Portage

Portage 2.1.x

Comandos más utilizados 2.1.x

  • Sincronizar el árbol de portage, esto lo hago todos los días usando el cron:
 # emerge --sync
 # eix-update 
  • Verificar que hay nuevo para decidir si lo actualizo
# emerge -DuvNp world
  • Actualizar el software nuevo
# emerge -DuvN world                        o bien...
# nohup emerge -DuvN world &       <== en background
# emerge -DuvNp world
  • De vez en cuando recomiendo ejecutar revdep-rebuild:
# revdep-rebuild



Migración a DIRECTORIO /etc/portage/package.keywords

  • En Junio 2010 decido cambiar la forma de trabajar con el fichero keywords. En vez de tener un único fichero con todos los keywords, voy a pasar a tener varios ficheros keywords.
  • El cambio es muy simple. Hay que crear el directorio /etc/portage/package.keywords y crear ficheros en él con cualquier nombre.
  • Para migrar mi configuración actual, simplemente realizo los siguiente pasos:
# cd /etc/portage/
# mv package.keywords package.keywords.general
# mkdir package.keywords
# mv package.keywords.general package.keywords
# ls -al /etc/portage/package.keywords
total 56 
drwxr-xr-x 2 root root  4096 jun 19 13:14 .
drwxr-xr-x 7 root root  4096 jun 19 13:14 ..
-rw-r--r-- 1 root root 47850 jun 19 12:20 package.keywords.general



Migración a Portage 2.2

  • En Junio 2010 decido actualizar a la versión 2.2 de portage. El motivo es poder utilizar los "sets".
  • Preparo el fichero package.keywords y package.unmask
# Portage
=sys-apps/portage-2.2_rc67                            ~amd64
=sys-apps/sandbox-2.2                                 ~amd64
sys-apps/portage
sys-apps/portage                 doc


  • Ejecuto la instalación
# emerge -DuvN portage

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] sys-apps/sandbox-2.2 [1.6-r2] USE="(multilib%*)" 327 kB
[ebuild     U ] sys-apps/portage-2.2_rc67 [2.1.8.3] USE="-build -doc -epydoc -python3 (-selinux)" LINGUAS="-pl" 543 kB

Total: 2 packages (2 upgrades), Size of downloads: 870 kB
  • Al terminar la instalación muestra lo siguiente, de momento NO actualizo "world"
* If you're upgrading from a pre-2.2 version of portage you might
* want to remerge world (emerge -e world) to take full advantage
* of some of the new features in 2.2.
  • Se instalan los siguientes ejecutables:
--- replaced sym /usr/sbin/update-etc
--- replaced sym /usr/sbin/update-env
--- replaced sym /usr/sbin/regenworld
--- replaced sym /usr/sbin/quickpkg
--- replaced sym /usr/sbin/fixpackages
--- replaced sym /usr/sbin/etc-update
--- replaced sym /usr/sbin/env-update
--- replaced sym /usr/sbin/emerge-webrsync
--- replaced sym /usr/sbin/emaint
--- replaced sym /usr/sbin/dispatch-conf
--- replaced sym /usr/sbin/archive-conf
--- replaced dir /usr/sbin
--- replaced sym /usr/bin/repoman
--- replaced sym /usr/bin/portageq
--- replaced sym /usr/bin/emerge
--- replaced sym /usr/bin/egencache
--- replaced sym /usr/bin/ebuild
  • La documentación queda aquí:
/usr/share/doc/portage-2.2_rc67/RELEASE-NOTES.bz2
/usr/share/doc/portage-2.2_rc67/NEWS.bz2
/usr/share/doc/portage-2.2_rc67/ChangeLog.bz2
  • Release notes
* Portage now warns if an ebuild repository does not have a name, as several
  new features in 2.2 make use of or require named repositories. The repository
  name is stored in profiles/repo_name in each repository.
* Package set support: There are several important notes regarding package
  sets:
  - setnames have to be prefixed with @ (exceptions: 'world' and 'system' can
    be used without the prefix)
  - they may currently only include simple and versioned atoms or other sets,
    use conditionals or any-of constructs aren't possible yet
  - sets can be referenced either in other file-based sets or as argument to
    emerge, but not in ebuilds, config files or other tools at this time.
  - packages won't be unmerged if they are referenced by an installed package
    set (with the exception of the world set, and installed being determined
    by the world_sets file).
* "world" now includes separate "selected" and "system" sets, where the
  "selected" set includes packages listed in /var/lib/portage/world and nested
  sets that may be listed /var/lib/portage/world_sets.


Resolución de problemas

  • Realizo una primera prueba con la nueva versión y descubro un WARNING:
# emerge -DuvNp world
WARNING: One or more repositories have missing repo_name entries:

	/usr/local/portage/profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.
  • Se resuelve ejecutando lo siguiente
# mkdir /usr/local/portage/profiles
# echo local-repo > /usr/local/portage/profiles/repo_name


Ejemplo uso de "sets"


Comandos más utilizados 2.2.x

  • Sincronizar el árbol de portage, esto lo hago todos los días usando el cron:
 # emerge --sync
 # eix-update 
  • Verificar que hay nuevo para decidir si lo actualizo *** NOVEDAD EN 2.2: Hay que añadir system ***
# emerge -DuvNp system world
  • Actualizar el software nuevo
# emerge -DuvN system world                        o bien...
# nohup emerge -DuvN system world &       <== en background
# emerge -DuvNp system world
  • De vez en cuando recomiendo ejecutar revdep-rebuild:
# revdep-rebuild



Búsquedas

  • Buscar un paquete utilizando "emerge"
# emerge -s paquete

  • Buscar un paquete utilizando "eix". Recomiendo instalar "eix", es mucho más rápido.
# emerge -v eix && eix-update   (me instalé la versión 0.18.3 - Nov'09)

# eix -c paquete
  • Buscar qué USE utiliza un paquete
# equery u kopete 



Ficheros de configuración

etc-update

  • Tras hacer un upgrade hay que verificar qué ficheros de /etc necesitan manipularse.
# etc-update

# etc-proposals      * alternativa GUI a etc-update
# cfg-update         * alternativa a etc-update



Comandos útiles

  • Averiguar a quién (paquete) pertenece un determinado programa
# equery b /usr/bin/firefox 
[ Searching for file(s) /usr/bin/firefox in *... ]
www-client/mozilla-firefox-3.0.5 (/usr/bin/firefox)
  • Cuanto tardaría system?
# emerge -ep system | genlop -p 



Enlaces y Créditos

[1] http://wiki.luispa.com/ Página principal de LuisPa.


Volver a HowTo Servidor Gentoo Linux

--Luis 12:24 19 jun 2010 (CEST)