08
7月

CentOS 5.3 源文件配置总结

CentOS的网络源配置文件是: /etc/yum.repos.d/ 下的 CentOS-Base.repo,本文提供其 5.3版本的:网通,电信,第三方源各一个。

配置方法一般是:
1.终端下 vi /etc/yum.repos.d/CentOS-Base.repo,删除里面原来的所有内容,然后用下面的相应内容替换。
2.把下面相应内容,保存为:CentOS-Base.repo,然后用mv命令,替换旧的“/etc/yum.repos.d/CentOS-Base.repo”也可以。
3.配置好后,别忘了 yum update

一.国内某大学源(电信网通皆可使用)

[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.3/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos6

#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.3/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.3/addons/$basearch/

二. 国内电信源

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever – Base
baseurl=http://centos.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever – Updates
baseurl=http://centos.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever – Addons
baseurl=http://centos.ustc.edu.cn/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
baseurl=http://centos.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus
baseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

三. 第三方源配置

在服务器构建的过程中,我们将要用到的一些工具不存在于CentOS中yum的官方库中,所以需要定义yum的非官方库文件,让一些必需的工具通过yum也能够安装。

[root@sample ~]# vi /etc/yum.repos.d/dag.repo ← 建立dag.repo,定义非官方库,内容如下5行:

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

[root@sample ~]# rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt ← 导入非官方库的GPG

剩下的慢慢发现吧。不过CentOS的源,确实是少的可怜。。。。唉~

原载: OwnLinux.org
原文标题: CentOS 5.3 源文件配置总结
原文链接:http://www.ownlinux.org/2009/07/08/centos-5-3-base-repo.html
OwnLinux.org 版权所有,转载时必须以链接形式注明作者和原始出处及本声明。否则,请勿转载!!


任何商业网站未经许可请勿转摘!本站将保留追究其法律责任的权利。

1 条评论了已经

发表评论

名字(必须)
邮箱(不会被公布)(必须)
网址

字体为 粗体 是必填项目,邮箱地址 永远不会 公布。

允许部分 HTML 代码:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
URLs(网站链接)必须完整有效 (比如: http://www.ownlinux.org),所有标签都必须完整的关闭。

超出部分系统将会自动分段及换行。

请保证评论内容是与日志或 Blog 内容相关的,灌水、攻击性或不恰当的评论 可能 会被编辑或删除。

    站内搜索

    赞助商

    标签

    最近访问