CentOS 6.3的中科大yum更新源设置,以及第三方源(EPEL等)设置
来源:互联网 发布:江西网络行政学院 编辑:程序博客网 时间:2024/05/02 05:07
本来是打算折腾个fedora来玩玩的,不过由于vmware中无法开启gnome3,只能使用fallback模式,又不习惯KDE等其他环境的风格,无奈只能放弃。之后查来找去,就找了个CentOS来玩玩。
由于使用的是校园网,国外的yum源几乎都不能正常使用,而且sohu和163的也老抽风。本来在fedora下国内的中科大和上海交大都可以使用,但是在CentOS6中就显得很无奈了,翻遍了网络也找不出个可用*.repo出来。
一、安装yum-priorities插件。
这个插件是用来设置yum在调用软件源时的顺序的。因为官方提供的软件源,都是比较稳定和被推荐使用的。因此,官方源的顺序要高于第三方源的顺序。如何保证这个顺序,就需要安装yum-priorities这插件了。
[root@CentOS ~]# yum install 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-Base.repo配置为(CentOS 6.0):
# 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 - Basebaseurl=http://mirrors.ustc.edu.cn/centos/6.3/os/$basearch/gpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6priority=1#released updates[updates]name=CentOS-$releasever - Updatesbaseurl=http://mirrors.ustc.edu.cn/centos/6.3/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6priority=1#packages used/produced in the build but not released#[addons]#name=CentOS-$releasever - Addons#baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/addons/$basearch/#gpgcheck=1#gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-$releasever - Extrasbaseurl=http://mirrors.ustc.edu.cn/centos/6.3/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6priority=1#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plusbaseurl=http://mirrors.ustc.edu.cn/centos/6.3/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6priority=2[contrib]name=CentOS-$releasever - Contribbaseurl=http://mirrors.ustc.edu.cn/centos/6.3/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6priority=2
二、下载与安装相应EPEL的rpm文件包
1、下载与安装EPEL的rpm文件包
32位系统
國內較快的源:http://mirrors.ustc.edu.cn/fedora/epel/6/i386/epel-release-6-7.noarch.rpm
64位系统
[root@CentOS ~]# rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
國內較快的源:http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-7.noarch.rpm
如果您不清楚您的系统内核,请使用uname -a命令来查看您的内核信息。
2、导入DAG的PGP Key
[root@CentOS ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
3、设置/etc/yum.repos.d/epel.repo文件中源的级别,就是添加priority=11这句。
如我的epel.repo文件内容:
[epel]name=Extra Packages for Enterprise Linux 6 - $basearchbaseurl=http://mirrors.ustc.edu.cn/fedora/epel/6/$basearch#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch#failovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6priority=11[epel-debuginfo]name=Extra Packages for Enterprise Linux 6 - $basearch - Debugbaseurl=http://mirrors.ustc.edu.cn/fedora/epel/6/$basearch/debug#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch#failovermethod=priorityenabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6gpgcheck=1priority=11[epel-source]name=Extra Packages for Enterprise Linux 6 - $basearch - Sourcebaseurl=http://mirrors.ustc.edu.cn/fedora/epel/6/SRPMS#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch#failovermethod=priorityenabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6gpgcheck=1priority=11
四、下载与安装相应rpmfusion的rpm文件包
(CentOS官方说这个软件库里面的软件稳定性不如rpmforge,选用!rpmfusion官方站:http://rpmfusion.org)
[root@CentOS ~]# rpm -Uvh http://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm
[root@CentOS ~]# rpm -Uvh http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm
五、测试
1、测试升级
[root@CentOS ~]# yum check-update
输出信息应该会有以下两行:
Loading “priorities” plugin
…
XX packages excluded due to repository priority protections
2、测试各插件是否生效
[root@CentOS ~]# yum check-update
如果出现类似以下输出,则表示配置成功。
Loaded plugins: fastestmirror, priorities, refresh-packagekit
Loading mirror speeds from cached hostfile
下面是一长串软件列表,最后一列形如:
epel
rpmforge
base
说明各个软件包的来源。
备注:
1、如果yum使用过程中出现类似以下错误,多半是因为rpmfusion的server无法连接,可以不用管它,或者将/etc/yum.repo.d/目录下rpmfusion相关的的repo文件中的enable=1改为0,关掉rpmfusion相关的源列表。
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. </script><frameset rows="*,0"><frame id="main" src=""><frame id="fr1" src=""></frameset><body></body></html>/
2、rpmfusion还会出现类似如下错误:
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmfusion-foo. Please verify its path and try again
原因引自http://rpmfusion.org/FAQ#head-33eabca99c1c4fa289a1d757bda49721cd27871a:
Yum cannot connect to the RPM Fusion servers if you get above message. That could be a problem with your local network or a problem with the MirrorManager servers from RPM Fusion. If it's the latter use this comment to temporary work around the problem:
方法是去除所有baseurl和mirrorlist前面的#如下:
su -c "sed -i 's|^#baseurl|baseurl| ; s|^mirrorlist|#mirrorlist|' /etc/yum.repos.d/rpmfusion*free*repo"
To undo the change later use this command:
su -c "sed -i 's|^baseurl|#baseurl| ; s|^#mirrorlist|mirrorlist|' /etc/yum.repos.d/rpmfusion*free*repo"
还可以参考:
http://www.2cto.com/os/201110/109175.html
http://www.2cto.com/os/201110/109176.html
- CentOS 6.3的中科大yum更新源设置,以及第三方源(EPEL等)设置
- ceph存储 rhel6.3设置第三方yum源epel
- yum更新源优先级设置
- RHEL/CentOS 7.x使用EPEL第三方yum源
- CentOS7安装第三方yum源EPEL
- centos的yum更新源问题
- CentOS安装第三方源(EPEL,RPMForge,RPMFusion)
- CentOS下使用第三方源EPEL
- CentOS 第三方源[epel/rpmforge]
- CentOS 6 安装EPEL/RPMFusion/更新源
- raspberrypi更新源设置以及注意点
- Centos 6.0 yum 更新源
- 配置CENTOS YUM更新源
- 配置CENTOS YUM更新源
- CentOS 6.2 使用第三方yum源安装更多rpm软件包以及centos系统的若干问题
- Centos6.3使用第三方 YUM源(EPEL)
- Centos7.x RHEL 配置EPEL第三方YUM源
- Centos7.x RHEL 配置EPEL第三方YUM源
- 第三节:TIPTOP ERP系统成本问题集
- 在main()之前调用Bootstrap函数
- form show 和form.ShowModal的区别
- 紫薇花开的季节(二)
- Wince6.0 下Camera(OV3640) 驱动开发笔记
- CentOS 6.3的中科大yum更新源设置,以及第三方源(EPEL等)设置
- J - Just Pour the Water 解题报告
- JavaScript基本教程之JavaScript语言的基础
- JavaScript之事件流
- Windows Sockets 错误码及出错原因
- Static类成员
- G - Give Me the Number 解题报告
- nginx pathinfo ..
- 书香与女人