yum



1、挂在iso文件


[root@localhostmedia]# mount /dev/cdrom /media

2、安装createrepo

createrepo是配置YUM源的配置工具,检查当前是否已经安装createrepo包的安装情况:

[root@localhostPackages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm

warning:createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key IDec551f03: NOKEY

error: Faileddependencies:

       deltarpm is needed by createrepo-0.9.8-4.el6.noarch

       python-deltarpm is needed by createrepo-0.9.8-4.el6.noarch

[root@localhostPackages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm

warning:deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature,key ID ec551f03: NOKEY

Preparing...               ########################################### [100%]

  1:deltarpm              ########################################### [100%]

[root@localhostPackages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm

warning:python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256Signature, key ID ec551f03: NOKEY

Preparing...               ########################################### [100%]

  1:python-deltarpm       ########################################### [100%]

[root@localhostPackages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm

warning:createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key IDec551f03: NOKEY

Preparing...               ########################################### [100%]

  1:createrepo            ########################################### [100%]

[root@localhost yum]#cp -r /media/* /mnt


3、创建yumrepository的xml-rpm-metadata

createrepo  -g  /mnt/Server/repodata/repomd.xml /mnt/Server/

createrepo  -g /mnt/HighAvailability/repodata/repomd.xml /mnt/HighAvailability/

createrepo  -g  /mnt/LoadBalancer/repodata/repomd.xml /mnt/LoadBalancer/

createrepo  -g /mnt/ResilientStorage/repodata/repomd.xml /mnt/ResilientStorage/

4、创建本地yumclient的repo文件

[root@localhost mnt]#cd /etc/yum.repos.d/

[root@localhostyum.repos.d]# ll

total 0

[root@localhostyum.repos.d]# vi local.repo


[HighAvailability]

name=HighAvailability

baseurl=file:/mnt/HighAvailability

enabled=1

gpgcheck=0

gpgkey=file:/mnt/RPM-GPG-KEY-oracle


[LoadBalancer]

name= LoadBalance

baseurl=file:/mnt/LoadBalancer

enabled=1

gpgcheck=0

gpgkey=file:/mnt/RPM-GPG-KEY-oracle


[ResilientStorage]

name=ResilientStorage

baseurl=file:/mnt/ResilientStorage

enabled=1

gpgcheck=0

gpgkey=file:/mnt/RPM-GPG-KEY-oracle


[Server]

name=Server

baseurl=file:/mnt/Server

gpgcheck=0

enabled=1

gpgkey=file:/mnt/RPM-GPG-KEY-oracle




保存后yum本地酒配置完毕。能够用yum install gcc測试


Didn't install anykeys