RHEL5.1 yum source with CD

Source: Internet
Author: User
RHEL5.4 can directly use the disc as the yum source, while RHEL5.1 cannot directly use the disc as the source. Otherwise ???????? Urlopenerrorunknownurltype: media, which needs to be modified. Note that the method provided here does not need to copy a large number of files on the disc. 1. mount the CD image to the/media/RHEL/directory [root@www.linuxidc.comDesktop] # mkdir/media/RHEL [ro

RHEL5.4 can directly use the disc as the yum source, while RHEL5.1 cannot directly use the disc as the source. Otherwise ???????? Urlopen error unknown url type: media, which needs to be modified. Note that the method provided here does not need to copy a large number of files on the disc.

1. Mount the CD image to the/media/RHEL/directory.
[root@www.linuxidc.com Desktop]#mkdir /media/RHEL
[root@www.linuxidc.com Desktop]#mount /root/rhel5.1.iso /media/RHEL -o loop

2. Generate a library file
[root@www.linuxidc.com Desktop]#mkdir /media/yum/
[root@www.linuxidc.com Desktop]#rpm -ivh /media/RHEL/Server/createrepo-0.4.4-2.fc6.noarch.rpm
[root@www.linuxidc.com Desktop]createrepo -o /media/yum/ -g /media/RHEL/Server/repodata/comps-rhel5-server-core.xml /media/RHEL/Server/
[root@www.linuxidc.com Desktop]mount --bind /media/yum/repodate/ /media/RHEL/Server/repodate/

3. generate dependency
[Root@www.linuxidc.com Desktop] # vim/etc/yum. repos. d/rhel-debuginfo.repo

 

Change to a similar
[rhel]
name=Red
baseurl=file:///media/RHEL/Server/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release

[root@www.linuxidc.com Desktop]# yum clean all;yum makecache

The local YUM source under RHEL5.1 is so OK. Note that a large number of files are not copied but mounted.

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.