RHEL5.4可以直接使用光盘作yum源,而RHEL5.1不能直接用光盘中的源,否则会出现????????urlopen error unknown url type: media,需要改造一番,注意这里提供的方法不用拷贝光盘中的大量文件.
1.将光盘镜像挂载到/media/RHEL/目录下[root@www.linuxidc.com Desktop]#mkdir /media/RHEL
[root@www.linuxidc.com Desktop]#mount /root/rhel5.1.iso /media/RHEL -o loop
2.生成库文件[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.生成依赖关系
[root@www.linuxidc.com Desktop]# vim /etc/yum.repos.d/rhel-debuginfo.repo
修改为类似[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
RHEL5.1下的本地YUM源就这样OK了,注意,这里并没有拷贝大量的文件,而是挂载.
urlopen error unknown url type: media
RHEL5.1 直接挂载光盘做yum看来是不成功的,安装软件提示error was [Errno 4] IOError:
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for vsftpd to pack into transaction set.
media://1250663123.136977%232/vsftpd-2.0.5-16.el5.i386.rpm: [Errno 4] IOError:
Trying other mirror.
Error: failed to retrieve vsftpd-2.0.5-16.el5.i386.rpm from rhel
error was [Errno 4] IOError:
不过本人知道RHEL5.4是可以用光盘并且直接作yum的.没办法,RHEL5.1下只能将光盘内Server目录拷贝到本地,然后再做设置,记住别忘记createrepo.