让CentOS 6 yum源支持更多rpm包的升级(3)

三、下载与安装相应rpmforge的rpm文件包

1、下载rpmforge的rpm文件包

32位系统
[root@CentOS ~]# wget

64位系统
[root@CentOS ~]# wget rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

2、安装DAG的PGP Key

[root@CentOS ~]# rpm --import

3、验证rpmforge的rpm文件包

[root@CentOS ~]# rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm
如果报XXX not an rpm package的错,查看是否wget下载的包不完整,包的大小是12K

4、安装rpmforge的rpm文件包

[root@CentOS ~]# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.*.rpm

5、设置/etc/yum.repos.d/rpmforge.repo文件中源的级别,就是添加priority=12这句,如我的rpmforge.repo文件内容:
### Name: RPMforge RPM Repository for RHEL 6 - dag
### URL:
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = RedHat/el6/en/$basearch/rpmforge
mirrorlist =
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=12

[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = $basearch/extras
mirrorlist =
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = $basearch/testing
mirrorlist =
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

四、下载与安装相应rpmfusion的rpm文件包

(CentOS官方说这个软件库里面的软件稳定性不如rpmforge,选用!rpmfusion官方站:)

[root@CentOS ~]# rpm -Uvh

[root@CentOS ~]# rpm -Uvh

五、测试

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 src=""><frame 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
原因引自#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"

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/23280.html