最新消息:三苏博客专业为广大站长朋友提供网站源码

RHEL7 7.2 7.3解决无法使用YUM源问题

Linux 三苏 218浏览 0评论

RHEL的YUM源需要注册用户才能更新使用,由于CentOS和RHEL基本没有区别,并且CentOS已经被REHL收购。所以将RHEL的YUM源替换为CentOS即可。
问题如下:
[[email protected] ~]# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repolist: 0

解决方法:
1.清除原有RHEL的YUM及相关软件包。
rpm -qa | grep yum | xargs rpm -e –nodeps
rpm -qa |grep python-urlgrabber|xargs rpm -e –nodeps

rpm -qa |grep python-iniparse|xargs rpm -e –nodeps

2.下载163的yum 安装包

http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm

3.安装软件包。
rpm -ivh python-iniparse-0.3.1-2.1.el7.noarch.rpm
rpm -ivh python-urlgrabber-3.9.1-11.el7.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-17.el7.x87_74.rpm
rpm -ivh yum-plugin-fastestmirror-1.1.30-37.el7.noarch.rpm yum-3.2.29-73.el7.centos.noarch.rpm
*注释yum-plugin-fastestmirror和yum-3.2.29要一起安装。

如果按照遇到问题:发现错误,python-urlgrabber版本必须大于等于3.9.1-10
# rpm -ivh  yum-3.2.29-73.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el7.noarch.rpm
warning: yum-3.2.29-73.el7.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
python-urlgrabber >= 3.9.1-10 is needed by yum-3.2.29-73.el7.centos.noarch
查看系统的python信息
# rpm -qa|grep python

发现python-urlgrabber-3.9.1-9.el7.noarch 版本低于3.9.1-10
卸载:python-urlgrabber-3.9.1-9.el7.noarch
rpm -e python-urlgrabber-3.9.1-9.el7.noarch
安装:rpm -ivh python-urlgrabber-3.9.1-11.el7.noarch.rpm

安装yum
# rpm -ivh yum-*

4、创建文件/etc/yum.repos.d/rhel-debuginfo.repo并写入

[base]
name=CentOS-$releasever – Base
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

 

#released updates
[updates]
name=CentOS-$releasever – Updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

 

[extras]
name=CentOS-$releasever – Extras
baseurl=http://mirrors.163.com/centos/7/extras//$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[centosplus]
name=CentOS-$releasever – Plus
“rhel.repo” 26L, 690C

5、清理yum缓存并升级系统

yum clean all

yum makecache #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度
yum update  #升级所有包,改变软件设置和系统设置,系统版本内核都升级

6、 安装 epel 源

yum install epel-release

转载请注明:三苏博客 » RHEL7 7.2 7.3解决无法使用YUM源问题

发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址