Crear repositorio local (Julian Garcia-Sotoca)

Page last edited hace 2059 días 13 horas
De Solaris-ES
Saltar a: navegación, buscar
  • Concatenar las imágenes ISO y montarlas en un directorio:
$ cat sol-11-1111-repo-full.iso-a sol-11-1111-repo-full.iso-b > sol-11-1111-repo-full.iso
root@s11template:/var/tmp# mkdir /export/repoSolaris11
root@s11template:/var/tmp# mv sol-11-1111-repo-full.iso /export/repoSolaris11/
root@s11template:/var/tmp# mount -F hsfs /export/repoSolaris11/sol-11-1111-repo-full.iso /mnt
root@s11template:/var/tmp# ls /mnt
COPYRIGHT  NOTICES    README     repo
  • Sincronizar el contenido de la ISO con el directorio que servirá como repositorio:
root@s11template:/var/tmp# rsync -aP /mnt/repo/ /export/repoSolaris11
sending incremental file list
./
pkg5.repository
         240 100%    0.00kB/s    0:00:00 (xfer#1, to-check=1378/1380)
publisher/
publisher/solaris/
publisher/solaris/catalog/
publisher/solaris/catalog/catalog.attrs
        1250 100%   23.94kB/s    0:00:00 (xfer#2, to-check=1369/1380)
publisher/solaris/catalog/catalog.base.C
      602328 100%    6.24MB/s    0:00:00 (xfer#3, to-check=1368/1380)
publisher/solaris/catalog/catalog.dependency.C
  • Desmontar la ISO
root@s11template:/var/tmp# umount /mnt
  • Crear el indice del repositorio:
root@s11template:/var/tmp# pkgrepo -s /export/repoSolaris11 refresh
Initiating repository refresh.
  • Configurar y habilitar los servicios de publisher para hacer accesible el repositorio por http
root@s11template:/var/tmp# svccfg -s application/pkg/server setprop pkg/inst_root=/export/repoSolaris11
root@s11template:/var/tmp# svccfg -s application/pkg/server setprop pkg/readonly=true
root@s11template:/var/tmp# svcprop -p pkg/inst_root application/pkg/server
/export/repoSolaris11
  • Verificar las propiedades del servicio de repositorio:
root@s11template:/var/tmp# svcprop application/pkg/server
pkg/address net_address 
pkg/cfg_file astring ""
pkg/content_root astring usr/share/lib/pkg
pkg/debug astring ""
pkg/file_root astring ""
pkg/log_access astring none
pkg/log_errors astring stderr
pkg/mirror boolean false
pkg/pkg_root astring /
pkg/port count 80
pkg/proxy_base astring ""
pkg/socket_timeout count 60
pkg/sort_file_max_size astring ""
pkg/ssl_cert_file astring ""
pkg/ssl_dialog astring smf
pkg/ssl_key_file astring ""
pkg/threads count 60
pkg/writable_root astring ""
pkg/inst_root astring /export/repoSolaris11
pkg/readonly boolean true
pkg_bui/feed_description ustring ""
pkg_bui/feed_icon ustring web/_themes/pkg-block-icon.png
pkg_bui/feed_logo ustring web/_themes/pkg-block-logo.png
pkg_bui/feed_name ustring package\ repository\ feed
pkg_bui/feed_window count 24
pkg_secure/read_authorization astring solaris.smf.read.pkg-server
pkg_secure/ssl_key_passphrase astring ""
fs/entities fmri svc:/system/filesystem/local
fs/grouping astring require_all
fs/restart_on astring none
fs/type astring service
autofs/entities fmri svc:/system/filesystem/autofs
autofs/grouping astring optional_all
autofs/restart_on astring none
autofs/type astring service
ntp/entities fmri svc:/network/ntp
ntp/grouping astring optional_all
ntp/restart_on astring none
ntp/type astring service
network/entities fmri svc:/milestone/network
network/grouping astring require_all
network/restart_on astring none
network/type astring service
manifestfiles/lib_svc_manifest_application_pkg_pkg-server_xml astring /lib/svc/manifest/application/pkg/pkg-server.xml
general/entity_stability astring Unstable
start/exec astring %{pkg/pkg_root}/lib/svc/method/svc-pkg-depot\ %m
start/timeout_seconds count 0
start/type astring method
stop/exec astring %{pkg/pkg_root}/lib/svc/method/svc-pkg-depot\ %m\ %{restarter/contract}
stop/timeout_seconds count 30
stop/type astring method
tm_common_name/C ustring image\ packaging\ repository
  • Habilitar los servicios recargando las propiedades modificadas:
root@s11template:/var/tmp# svcadm refresh application/pkg/server
root@s11template:/var/tmp# svcadm enable application/pkg/server
  • Configurar el publisher local como repositorio principal para el sistema:
root@s11template:/var/tmp# pkg set-publisher -G '*' -M '*' -g http://localhost:80/ solaris
root@s11template:/var/tmp# pkg publisher
PUBLISHER                             TYPE     STATUS   URI
solaris                               origin   online   http://localhost:80/
  • También se puede configurar el repositorio de oracle:
root@s11template:~# pkg set-publisher \
> -k /var/pkg/ssl/Oracle_Solaris_11_Support.key.pem \
> -c /var/pkg/ssl/Oracle_Solaris_11_Support.certificate.pem \
> -g https://pkg.oracle.com/solaris/support/ \
> -G http://pkg.oracle.com/solaris/release/ solaris

NOTA: Los certificados se consiguen aqui: http://pkg-register.oracle.com/

root@s11template:~# pkg publisher
PUBLISHER                             TYPE     STATUS   URI
solaris                               origin   online   https://pkg.oracle.com/solaris/support/
  • Lanzar una simulación de actualización:
root@s11template:~# pkg update -nv
           Packages to install:       6
            Packages to update:     238
           Mediators to change:       1
     Estimated space available: 1.67 GB
Estimated space to be consumed: 1.04 GB
       Create boot environment:     Yes
     Activate boot environment:     Yes
Create backup boot environment:      No
          Rebuild boot archive:     Yes

Changed mediators:
  mediator java:
           version: None -> 1.6 (system default)

Changed packages:
solaris
  database/mysql-51/library
    None -> 5.1.37,5.11-0.175.0.0.0.2.537:20111019T091844Z
  library/apr-util-13/apr-ldap

  • Listar paquetes con actualizaciones disponibles:
root@s11template:~# pkg list -u
NAME (PUBLISHER)                                  VERSION                    IFO
consolidation/SunVTS/SunVTS-incorporation         0.5.11-0.172.0.0.0.0.0     i--
consolidation/X/X-incorporation                   0.5.11-0.175.0.0.0.0.1215  i--
consolidation/cacao/cacao-incorporation           0.5.11-0.174.0.0.0.0.0     i--
consolidation/cns/cns-incorporation               0.5.11-0.175.0.0.0.1.0     i--
consolidation/desktop/desktop-incorporation       0.5.11-0.175.0.0.0.2.0     i--
consolidation/desktop/gnome-incorporation         0.5.11-0.175.0.0.0.2.0     i--
consolidation/install/install-incorporation       0.5.11-0.175.0.0.0.2.1482  i--
consolidation/ips/ips-incorporation               0.5.11-0.175.0.0.0.2.2576  i--
consolidation/java/java-incorporation             0.5.11-0.173.0.0.0.0.0     i--
consolidation/l10n/l10n-incorporation             0.5.11-0.175.0.0.0.1.765   i--
consolidation/ldoms/ldoms-incorporation           0.5.11-0.175.0.0.0.1.0     i--


  • Si no funciona la actualización y da time out es posible que sea debido a la configuración del proxy. Hay que configurar en las propiedades del servicio para que tome el proxy y también en las variables de entorno:
root@s11template:~# svccfg -s svc:/application/pkg/system-repository:default setprop config/http_proxy=astring: "http://vmwareupdate:vmw%40re@10.150.2.39:8080"
root@s11template:~# svccfg -s svc:/application/pkg/system-repository:default setprop config/https_proxy=astring: "http://vmwareupdate:vmw%40re@10.150.2.39:8080"

Reconfigurar el servicio

root@s11template:~# svcadm refresh svc:/application/pkg/system-repository:default

Verificacion de las propiedades:

root@s11template:~# svcprop pkg/system-repository | grep proxy
config/http_proxy astring http://vmwareupdate:vmw%40re@10.150.2.39:8080
config/https_proxy astring http://vmwareupdate:vmw%40re@10.150.2.39:8080

Variables de entorno

root@s11template:~# export http_proxy="http://vmwareupdate:vmw%40re@10.150.2.39:8080"
root@s11template:~# export https_proxy="http://vmwareupdate:vmw%40re@10.150.2.39:8080"

Actualizando el repositorio[editar]

root@s11template:/var/tmp# export http_proxy="http://vmwareupdate:vmw%40re@10.150.2.39:8080"
root@s11template:/var/tmp# export https_proxy="http://vmwareupdate:vmw%40re@10.150.2.39:8080"

Existen dos repositorios de oracle, uno con los paquetes de la release y otro con los paquetes con actualizaciones y parches. Con el primero es normal que no actualice nada:

root@s11template:~# pkgrecv -s http://pkg.oracle.com/solaris/release/ -d /export/repoSolaris11 '*'
Processing packages for publisher solaris ...
Retrieving and evaluating 4292 package(s)...


root@s11template:~# pkgrecv -s https://pkg.oracle.com/solaris/support/ -d /export/repoSolaris11  --key /var/pkg/ssl/Oracle_Solaris_11_Support.key.pem --cert /var/pkg/ssl/Oracle_Solaris_11_Support.certificate.pem '*'
Processing packages for publisher solaris ...
Retrieving and evaluating 4304 package(s)...                    
PROCESS                                         ITEMS     GET (MB)    SEND (MB)
mail/thunderbird                               21/391  56.5/2535.6  56.9/8402.3

Actualizando un sistema[editar]

  • Lanzar el parcheo:
root@s11template:~# pkg update 
           Packages to install:   6
            Packages to update: 238
           Mediators to change:   1
       Create boot environment: Yes
Create backup boot environment:  No

DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                              244/244   6412/6412  166.1/166.1

PHASE                                        ACTIONS
Removal Phase                              1944/1944 
Install Phase                              2455/2455 
Update Phase                               8580/8580 

PHASE                                          ITEMS
Package State Update Phase                   482/482 
Package Cache Update Phase                   238/238 
Image State Update Phase                         2/2 

A clone of solaris exists and has been updated and activated.
On the next boot the Boot Environment solaris-1 will be
mounted on '/'.  Reboot when ready to switch to this updated BE.


---------------------------------------------------------------------------
NOTE: Please review release notes posted at:

http://www.oracle.com/pls/topic/lookup?ctx=E23824&id=SERNS
---------------------------------------------------------------------------
  • Listar los Boot Enviroments para verificar que se ha creado uno nuevo y se ha activado para el próximo reboot:
root@s11template:~# beadm list
BE           Active Mountpoint Space   Policy Created          
--           ------ ---------- -----   ------ -------          
solaris      N      /          6.72M   static 2012-10-08 17:42 
solaris-1    R      -          4.04G   static 2012-10-10 16:26 
vmtools      -      -          591.35M static 2012-10-09 12:02 
vmwareTools2 -      -          56.0K   static 2012-10-09 12:26 
  • Reiniciar el sistema para activar el nuevo Boot Enviroment
root@s11template:~# init 6
  • Verificar que la versión del kernel es superior:
root@s11template:~# pkg info system/kernel
          Name: system/kernel
       Summary: Core Kernel
   Description: Core operating system kernel, device drivers and other modules.
      Category: System/Core
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.0.11.0.4.1
Packaging Date: August 30, 2012 02:21:42 PM 
          Size: 32.04 MB
          FMRI: pkg://solaris/system/kernel@0.5.11,5.11-0.175.0.11.0.4.1:20120830T142142Z

La anterior era esta:

root@s11client:~#  pkg info system/kernel
          Name: system/kernel
       Summary: Core Kernel
   Description: Core operating system kernel, device drivers and other modules.
      Category: System/Core
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.0.0.0.2.1
Packaging Date: October 19, 2011 07:57:11 AM 
          Size: 32.33 MB
          FMRI: pkg://solaris/system/kernel@0.5.11,5.11-0.175.0.0.0.2.1:20111019T075711Z