关于 yum 在红帽六和红帽五的区别
红帽五的配置文件就在/etc/yum.repos.d/目录下 xxx.repo,例如:(我是把光盘iso挂载在/mnt目录下,rhel5.repo是自己编辑的)
cat rhel5.repo
[rhel-Server]
baseurl=file:///mnt/Server
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
[rhel-VT]
baseurl=file:///mnt/VT
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
[rhel-Cluster]
baseurl=file:///mnt/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
[rhel-ClusterStorage]
baseurl=file:///mnt/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
红帽六的配置文件和五一样的目录下,但是配置文件的内容不一样。例如:
cat rhel6.repo
[rhel-Server]
baseurl=file:///mnt/Server
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
[rhel-HighAvailability]
baseurl=file:///mnt/HighAvailability
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
[rhel-LoadBalancer]
baseurl=file:///mnt/LoadBalancer
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
[rhel-ResilientStorage]
baseurl=file:///mnt/ResilientStorage
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
[rhel-ScalableFileSystem]
baseurl=file:///mnt/ScalableFileSystem
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
还有一个比较特殊的红帽六的配置文件,其内容是:
cat rhel6.repo
[repodata]
baseurl=file:///mnt/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-beta,file:///mnt/RPM-GPG-KEY-redhat-release
这个配置很神奇吧,其实五和六还是一个样,yum 的最重要的看有没有 xml。例如:
红帽五:
/Cluster/repodata/repomd.xml
/ClusterStorage/repodata/repomd.xml
/Server/repodata/repomd.xml
/VT/repodata/repomd.xml
红帽六:
/HighAvailability/repodata/repomd.xml
/LoadBalancer/repodata/repomd.xml
/ResilientStorage/repodata/repomd.xml
/ScalableFileSystem/repodata/repomd.xml
/Server/repodata/repomd.xml
/repodata/repomd.xml
就是因为这个,你的配置文件就在写上面所写内容。