First, put the disc into the optical drive. Step 1: # mount to check where the disk is mounted. For example, I am/dev/hdc. # Mount-t/dev/hdc/mnt/rhel Step 2: Create a repo file # vim/etc/yum. repos. d/rhel-local.repo [Cluster] name = RedHatEnterpriseLinux $ releaseve First, put the disc into the optical drive.
Step 1: # mount
Check where the disk is attached. For example, I am/dev/hdc.
# Mount-t/dev/hdc/mnt/rhel
Step 2: Create a repo File
# Vim/etc/yum. repos. d/rhel-local.repo
[Cluster]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Cluster
Baseurl = file: // media/rhel/Cluster
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
[ClusterStorage]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-ClusterStorage
Baseurl = file: // media/rhel/ClusterStorage
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Server]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Server
Baseurl = file: // media/rhel/Server
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[VT]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-VT
Baseurl = file: // media/rhel/VT
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Step 3:
# Mkdir-p/var/rhel/{Cluster, ClusterStorage, Server, VT}
Step 4: Install the createrepo command.
# Cd/mnt/rhel/Server/
# Rpm-ivh createrepo-0.4.11-3.el5.noarch.rpm
Step 5: recreate the comps-rhel5-*. xml file
# Createrepo-o/var/rhel/Cluster-g/media/rhel/Cluster/repodata/comps-rhel5-cluster.xml/media/rhel/Cluster
# Createrepo-o/var/rhel/ClusterStorage-g/media/rhel/ClusterStorage/repodata/comps-rhel5-cluster-st.xml/media/rhel/ClusterStorage
# Createrepo-o/var/rhel/Server-g/media/rhel/Server/repodata/comps-rhel5-server-core.xml/media/rhel/Server
# Createrepo-o/var/rhel/VT-g/media/rhel/VT/repodata/comps-rhel5-vt.xml/media/rhel/VT
# Mount -- bind/var/rhel/Cluster/repodata/media/rhel/Cluster/repodata
# Mount -- bind/var/rhel/ClusterStorage/repodata/media/rhel/ClusterStorage/repodata
# Mount -- bind/var/rhel/Server/repodata/media/rhel/Server/repodata
# Mount -- bind/var/rhel/VT/repodata/media/rhel/VT/repodata
Step 6:
# Yum clean all
Step 7:
# Yum install package
In fact, only the red part can be used. Others are used for virtualization and cluster. You do not need to join.