Linux certification guide: RHEL5.4 configure yum as the local source

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.