Esto es especialmente útil para cuando se requiere instalar paquetes y utilitarios via YUM para evitar los errores por dependencias no encontradas. Y por supuesto, no hay cuenta de acceso para registrar el server en RHN.
Identificar cuál es la imágen iso que se debe utilizar
Es necesario conocer la versión de RHEL, arquitectura (32 o 64 bits)
[root@nabucodonosor ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
[root@nabucodonosor ~]#
Copiar la imágen ISO al Server.
Montar la imágen ISO en un directorio:
[root@nabucodonosor ~]# mkdir -p /media/ISO
[root@nabucodonosor ~]# mount -o loop,rw /root/rhel-server-5.8-x86_64-dvd.iso /media/ISO
Crear un directorio y copiar todo el contenido abierto del ISO
[root@nabucodonosor ~]# mkdir -p /media/mediaopeniso
[root@nabucodonosor ~]# cp -r /media/ISO/* /media/mediaopeniso
Localizar e Instalar el paquete createrepo
[root@nabucodonosor ~]# cd /media/ISO/[root@nabucodonosor ISO]# find -iname createrepo*
./Server/createrepo-0.4.11-3.el5.noarch.rpm
[root@nabucodonosor ISO]# cd Server
[root@nabucodonosor Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
Ejecutar createrepo para crear la metadata.
[root@nabucodonosor Server]# cd /media/mediaopeniso
[root@nabucodonosor mediaopeniso]# createrepo .
3414/3414 - Cluster/cluster-cim-0.12.1-7.el5.x86_64.rpm pm6_64.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@nabucodonosor mediaopeniso]#
Debe generar el siguiente directorio:
[root@nabucodonosor mediaopeniso]# ls -ltr /media/mediaopeniso/repodata/
total 15764
-rw-r--r-- 1 root root 1194548 Jul 25 15:14 primary.xml.gz
-rw-r--r-- 1 root root 11566736 Jul 25 15:14 other.xml.gz
-rw-r--r-- 1 root root 3349515 Jul 25 15:14 filelists.xml.gz
-rw-r--r-- 1 root root 951 Jul 25 15:14 repomd.xml
[root@nabucodonosor mediaopeniso]#
Crear un archivo de configuración en los repos de YUM
[root@nabucodonosor media]# cd /etc/yum.repos.d/
[root@nabucodonosor yum.repos.d]# cat rheldvd.repo
[rheldvd]
name=rheldvd
baseurl=file:///media/mediaopeniso/
enabled=1
gpgcheck=0
[root@nabucodonosor yum.repos.d]#
Limpiar toda la caché de yum.
[root@nabucodonosor yum.repos.d]# rm -rfv /var/cache/yum/*
removed `/var/cache/yum/rheldvd/filelists.xml.gz'
removed `/var/cache/yum/rheldvd/primary.xml.gz.sqlite'
removed `/var/cache/yum/rheldvd/other.xml.gz.sqlite'
removed `/var/cache/yum/rheldvd/repomd.xml'
removed `/var/cache/yum/rheldvd/cachecookie'
removed `/var/cache/yum/rheldvd/other.xml.gz'
removed `/var/cache/yum/rheldvd/filelists.xml.gz.sqlite'
removed `/var/cache/yum/rheldvd/primary.xml.gz'
removed directory: `/var/cache/yum/rheldvd/packages'
removed directory: `/var/cache/yum/rheldvd'
[root@nabucodonosor yum.repos.d]# yum clean all && yum clean metadata && yum clean dbcache && yum makecache && yum update -y
Loaded plugins: rhnplugin
Cleaning up Everything
Loaded plugins: rhnplugin
0 metadata files removed
0 sqlite files removed
0 metadata files removed
Loaded plugins: rhnplugin
0 sqlite files removed
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
rheldvd | 951 B 00:00
rheldvd/filelists | 3.2 MB 00:00
rheldvd/other | 11 MB 00:00
rheldvd/primary | 1.1 MB 00:00
rheldvd 3414/3414
rheldvd 3414/3414
rheldvd 3414/3414
Metadata Cache Created
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Setting up Update Process
No Packages marked for Update
[root@nabucodonosor yum.repos.d]#
Revisar que el reprositorio esté siendo considerado por YUM
[root@nabucodonosor yum.repos.d]# yum repolist
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
repo id repo name status
rheldvd rheldvd 3,414
repolist: 3,414
[root@nabucodonosor yum.repos.d]#
A partir de este momento ya es posible instalar un paquete via yum.
Observar el siguiente ejemplo:
[root@nabucodonosor yum.repos.d]# yum install wireshark.x86_64
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package wireshark.x86_64 0:1.0.15-1.el5_6.4 set to be updated
--> Processing Dependency: libsmi.so.2()(64bit) for package: wireshark
--> Running transaction check
---> Package libsmi.x86_64 0:0.4.5-2.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================================
Installing:
wireshark x86_64 1.0.15-1.el5_6.4 rheldvd 12 M
Installing for dependencies:
libsmi x86_64 0.4.5-2.el5 rheldvd 2.4 M
Transaction Summary
================================================================================================================================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)
Total download size: 14 M
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 7.3 GB/s | 14 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libsmi 1/2
Installing : wireshark 2/2
Installed:
wireshark.x86_64 0:1.0.15-1.el5_6.4
Dependency Installed:
libsmi.x86_64 0:0.4.5-2.el5
Complete!
[root@nabucodonosor yum.repos.d]#
Agradecimientios a mi colega sebatinez!
Fuentes
Buena nota, pero incompleta, aquí se puede encontrar la información que falta: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-yum-upgrade-system.html
ResponderEliminargracias por la info!
Eliminar