从Oracle Enterprise Linux cdrom ISO中建立yum仓库

一直都在用ubuntu,熟悉了apt,就很小用回redhat之类的发行版了,最近要装oracle rac在ubuntu 8.04上死活不行,没办法,只有下载oracle自己的发行版了.

一共5张cd, 先把他mount到本地来

mount -o loop /media/ISO/ora_ent_lnx/Enterprise-R5-U2-Server-i386-disc1.iso /yum/cd1
....

结果

/media/ISO/ora_ent_lnx/Enterprise-R5-U2-Server-i386-disc1.iso on /yum/cd1 type iso9660 (rw,loop=/dev/loop0)
/media/ISO/ora_ent_lnx/Enterprise-R5-U2-Server-i386-disc2.iso on /yum/cd2 type iso9660 (rw,loop=/dev/loop1)
/media/ISO/ora_ent_lnx/Enterprise-R5-U2-Server-i386-disc3.iso on /yum/cd3 type iso9660 (rw,loop=/dev/loop2)
/media/ISO/ora_ent_lnx/Enterprise-R5-U2-Server-i386-disc4.iso on /yum/cd4 type iso9660 (rw,loop=/dev/loop3)
/media/ISO/ora_ent_lnx/Enterprise-R5-U2-Server-i386-disc5.iso on /yum/cd5 type iso9660 (rw,loop=/dev/loop4)

然后新建一个文件 /etc/yum.repos.d/cdrom.repo

内容如下:

[Server]
name=Server
baseurl=file:///yum/cd1/Server
   file:///yum/cd2/Server
   file:///yum/cd3/Server
   file:///yum/cd4/Server
   file:///yum/cd5/Server
enabled=1
gpgchechk=1
gpgkey=file:///yum/cd1/RPM-GPG-KEY-oracle

[Cluster]
name=Cluster
baseurl=file:///yum/cd1/Cluster
   file:///yum/cd2/Cluster
   file:///yum/cd3/Cluster
   file:///yum/cd4/Cluster
   file:///yum/cd5/Cluster
enabled=1
gpgchechk=1
gpgkey=file:///yum/cd1/RPM-GPG-KEY-oracle

[ClusterStorage]
name=Cluster
baseurl=file:///yum/cd1/ClusterStorage
   file:///yum/cd2/ClusterStorage
   file:///yum/cd3/ClusterStorage
   file:///yum/cd4/ClusterStorage
   file:///yum/cd5/ClusterStorage
enabled=1
gpgchechk=1
gpgkey=file:///yum/cd1/RPM-GPG-KEY-oracle

[VT]
name=VT
baseurl=file:///yum/cd1/VT
   file:///yum/cd2/VT
   file:///yum/cd3/VT
   file:///yum/cd4/VT
   file:///yum/cd5/VT
enabled=1
gpgchechk=1
gpgkey=file:///yum/cd1/RPM-GPG-KEY-oracle

现在可以像apt一样了

yum seach xen
yum install xen......

不错!