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.