现在的位置: 首页 > 综合 > 正文

配置yum源【附脚本】

2014年12月05日 ⁄ 综合 ⁄ 共 1470字 ⁄ 字号 评论关闭

[root@localhost /]# uname -a

Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux

1.挂载光盘镜像 rhel-server-5.5-i386-dvd.iso

[root@localhost /]# mount /dev/cdrom /mnt/
mount: block device /dev/cdrom is write-protected, mounting read-only

2.拷贝文件到本地 并安装createrepo

[root@localhost /]# mkdir    /yum

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

[root@localhost /]# cd /yum/Server

[root@localhost Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm

[root@localhost Server]# createrepo      -g      repodata/comps-rhel5-server-core.xml      ./

[root@localhost Server]# cd      ../Cluster

[root@localhost Cluster]# createrepo      -g      repodata/comps-rhel5-cluster.xml      ./

[root@localhost Cluster]cd      ../ClusterStorage/

[root@localhost ClusterStorage]createrepo      -g      repodata/comps-rhel5-cluster-st.xml      ./

[root@localhost ClusterStorage]cd      ../VT/

[root@localhost VT]createrepo      -g      repodata/comps-rhel5-vt.xml      ./

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

新建 local.repo  内容如下

[Cluster]
name=Cluster Directory
baseurl=file:///yum/Cluster
enabled=1
gpgcheck=0




[ClusterStorage]
name=ClusterStoage Directory
baseurl=file:///yum/ClusterStorage
enabled=1
gpgcheck=0






[Server]
name=Server
baseurl=file:///yum/Server
enabled=1
gpgcheck=0






[VT]
name=VT Directory
baseurl=file:///yum/VT
enabled=1
gpgcheck=0

删除   /etc/yum.repos.d  目录下  所有.repo的文件 ,除了刚刚配置好的local.repo

yum   clean   all

yum    install   包名

自己尝试安装

配置好的local.repo 下载

http://download.csdn.net/detail/jiajianjunneusoft/4121143

Shell脚本架设下载

http://download.csdn.net/download/jiajianjunneusoft/4140292

抱歉!评论已关闭.