14.5. Upgrading the System Off-line with ISO and Yum


For systems that are disconnected from the Internet or Red Hat Network, using the yum update command with the Red Hat Enterprise Linux installation ISO image is an easy and quick way to upgrade systems to the latest minor version. The following steps illustrate the upgrading process:
  1. Create a target directory to mount your ISO image. This directory is not automatically created when mounting, so create it before proceeding to the next step, as root, type:
    Copy to Clipboard Toggle word wrap
    mkdir mount_dir
    Replace mount_dir with a path to the mount directory. Typicaly, users create it as a subdirectory in the /media/ directory.
  2. Mount the Red Hat Enterprise Linux 5 installation ISO image to the previously created target directory. As root, type:
    Copy to Clipboard Toggle word wrap
    mount -o loop iso_name mount_dir
    Replace iso_name with a path to your ISO image and mount_dir with a path to the target directory. Here, the -o loop option is required to mount the file as a block device.
  3. Check the numeric value found on the first line of the .discinfo file from the mount directory:
    Copy to Clipboard Toggle word wrap
    head -n1 mount_dir/.discinfo
    The output of this command is an identification number of the ISO image, you need to know it to perform the following step.
  4. Create a new file in the /etc/yum.repos.d/ directory, named for instance new.repo, and add a content in the following form. Note that configuration files in this directory must have the .repo extension to function properly.
    Copy to Clipboard Toggle word wrap
    [repository] 
    mediaid=media_id 
    name=repository_name
    baseurl=repository_url
    gpgkey=gpg_key 
    enabled=1 
    gpgcheck=1
    
    Replace media_id with the numeric value found in mount_dir/.discinfo. Set the repository name instead of repository_name, replace repository_url with a path to a repository directory in the mount point and gpg_key with a path to the GPG key.
    For example, the repository settings for Red Hat Enterprise Linux 5 Server ISO can look as follows:
    Copy to Clipboard Toggle word wrap
    [rhel5-Server] 
    mediaid=1354216429.587870 
    name=RHEL5-Server
    baseurl=file:///media/rhel5/Server 
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 
    enabled=1 
    gpgcheck=1
    
  5. Update all yum repositories including /etc/yum.repos.d/new.repo created in previous steps. As root, type:
    Copy to Clipboard Toggle word wrap
    yum update
    This upgrades your system to the version provided by the mounted ISO image.
  6. After successful upgrade, you can unmount the ISO image, with the root privileges:
    Copy to Clipboard Toggle word wrap
    umount mount_dir
    where mount_dir is a path to your mount directory. Also, you can remove the mount directory created in the first step. As root, type:
    Copy to Clipboard Toggle word wrap
    rmdir mount_dir
  7. If you will not use the previously created configuration file for another installation or update, you can remove it. As root, type:
    Copy to Clipboard Toggle word wrap
    rm /etc/yum.repos.d/new.repo

Example 14.1. Upgrading from Red Hat Enterprise Linux 5.8 to 5.9

Imagine you need to upgrade your system without access to the Internet connection. To do so, you want to use an ISO image with the newer version of the system, called for instance RHEL5.9-Server-20121129.0-x86_64-DVD1.iso. You have crated a target directory /media/rhel5/. As root, change into the directory with your ISO image and type:
Copy to Clipboard Toggle word wrap
~]# mount -o loop RHEL5.9-Server-20121129.0-x86_64-DVD1.iso /media/rhel5/
To find the identification number of the mounted image, run:
Copy to Clipboard Toggle word wrap
~]# head -n1 /media/rhel5/.discinfo 
1354216429.587870
You need this number to configure your mount point as a yum repository. Create the/etc/yum.repos.d/rhel5.repo file and insert the following text into it:
Copy to Clipboard Toggle word wrap
[rhel5-Server] 
mediaid=1354216429.587870 
name=RHEL5-Server
baseurl=file:///media/rhel5/Server 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 
enabled=1 
gpgcheck=1
Update the yum repository, which effectively upgrades your system to a version provided by RHEL5.9-Server-20121129.0-x86_64-DVD1.iso. As root, execute:
Copy to Clipboard Toggle word wrap
~]# yum update
When your system is successfully upgraded, unmount the image, remove the target directory and the configuration file:
Copy to Clipboard Toggle word wrap
~]# umount /media/rhel5/
Copy to Clipboard Toggle word wrap
~]# rmdir /media/rhel5/
Copy to Clipboard Toggle word wrap
~]# rm /etc/yum.repos.d/rhel5.repo
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat, Inc.