红联Linux门户
Linux帮助

rhel5 配置yum源笔记

发布时间:2008-03-03 10:22:03来源:红联作者:bitrated
1. 安装yum
2. 修改.repo文件
ccd /etc/yum.repos.d/
#vi CentOS-Base.repo
写入一下内容:[code][base]
name=CentOS-5 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&
repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons

baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras

baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

# vi dag.repo
[dag]
name=Dag RPM Repository for RHEL5
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
enabled=1
gpgcheck=1
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt[/code]3. 导入key
#rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
4. 运行,测试
#yum update
文章评论

共有 6 条评论

  1. youzhongshishi 于 2010-08-21 18:23:49发表:

    我的也出了好多问题阿,但是貌似和你的不一样,现在还没搞定。。。

  2. yanlong938 于 2010-08-21 00:08:19发表:

    找了好几个yum源 自己还配了个 够用了

  3. gdh7201 于 2010-08-20 11:39:06发表:

    thanks!

  4. ys0290 于 2010-04-13 14:34:36发表:

    3# junyang517


    用rpm -qa|grep yum找到所有的yum包,然后在centos或者其他源里面找到相应的yum包,然后再多下载一个yum-fastestmirror的包,先把这个包装上,然后把查到的已安装的yum卸掉,用rpm -e ***,***为已安装的包,如果不能卸掉,在命令的最后加上--nodeps,然后把自己下载的centos的包装上,然后按照上面修改repo,不过个人认为中科大的源比上交大的快,不管电信还是教育网
    不过要是想保留rhel的风格和内核,可以禁掉它,具体办法是在/etc/yum.conf中加一句exclude ***,***为你要禁掉的文件,这样你升级的时候就不会把禁掉的文件升级了,具体禁什么,你可以搜我的一个帖子《用CentOS更新RHEL的问题》,在此感谢那位帮助我的仁兄!

  5. junyang517 于 2009-12-10 13:25:15发表:

    还要安装yum?????怎么安装?

  6. szitonline 于 2009-12-06 23:26:21发表:

    大哥。你上面的方法你试过的没有啊。我上网查了和你一样的。我试了不行啊。我的YUM还使用不了的。郁闷中