使用说明
首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
$ cd /etc/yum.repos.d/ (进入目录)
$ sudo wget http://mirrors.163.com/.help/CentOS6-Base-163.repo (下载源文件)
$ sudo cp CentOS6-Base-163.repo CentOS-Base.repo (替换)
# 使用以上yum源的话,最好把repo文件中的mirrorlist注释掉,因为系统会启动fastestmirror插件自动检测最快源,设置不一定起作用。
$ sudo yum makecache (生成缓存)
如何关闭yum-fastestmirror?
可以避免 [Errno -1] Metadata file does not match checksum 的发生
vi /etc/yum/pluginconf.d/fastestmirror.conf”
set "enable=0"
这个插件是用来设置yum在调用软件源时的顺序的。因为官方提供的软件源,都是比较稳定和被推荐使用的。因此,官方源的顺序要高于第三方源的 顺序。如何保证这个顺序,就需要安装yum-priorities这插件了。
# yum -y install yum-priorities
2、安装完yum-priorities插件后
需要设置/etc/yum.repos.d/ 目录下的.repo相关文件(如CentOS-Base.repo),
在这些文件中插入顺序指令:priority=N (N为1到99的正整数,数值越小越优先)
一般配置[base], [addons], [updates], [extras] 的priority=1,
[CentOSplus], [contrib] 的priority=2,
其他第三的软件源为:priority=N (推荐N>10)
为CentOS安装EPEL软件仓库
EPEL源
EPEL,即Extra Packages for Enterprise Linux,是由 Fedora 社区创建维护,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。EPEL中含有大量的软件,对官方标准源是一个很好的补充
wiki:http://fedoraproject.org/wiki/EPEL
Fedora EPEL 下载:http://mirrors.fedoraproject.org/publiclist/EPEL/
EPEL 下载地址:http://download.fedora.redhat.com/pub/epel/
请针对不同的版本下载相应的包。
Remi源
Remi源大家或许很少听说,不过Remi源GoFace强烈推荐,尤其对于不想编译最新版的linux使用者,因为Remi源中的软件几乎都是最新稳定版。或许您会怀疑稳定不?放心吧,这些都是Linux骨灰级的玩家编译好放进源里的,他们对于系统环境和软件编译参数的熟悉程度毋庸置疑。
Remi下载地址:http://rpms.famillecollet.com/
$ rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
您也需要针对不同的版本号下载。
RepoForge源
RepoForge是CentOS系统下的软件仓库,拥有4000多种的软件包,被CentOS社区认为是最安全也是最稳定的一个软件仓库。
RPMForge官方网站:http://repoforge.org/
RPMFusion源
如果您现在正在使用Fedora 15,对RPMFusion一定不陌生吧,各种音频软件如MPlayer在标准源中是没有的,一般先安装RPMFusion源,之后就可以放便地yum install各种需要的软件啦。
CentOS官方说RPMFusion软件库里面的软件稳定性不如rpmforge。
RPMFusion官网:http://rpmfusion.org/
Fedora 13, 14 and 15:
su -c ’yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.
noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm’
RHEL 6/CentOS 6 :
su -c ’rpm -Uvh http://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/6/i386/rpmfusion-nonfree-release-6-0.1.noarch.rpm’
其他版本请详见:http://rpmfusion.org/Configuration