问题
在Redhat上无法使用yum,检查版本为redhat6.8
# yum update
Plugin "product-id" can't be imported
Plugin "search-disabled-repos" can't be imported
Plugin "subscription-manager" can't be imported
Loaded plugins: aliases, changelog, kabi, ovl, presto, refresh-packagekit,
: security, tmprepo, verify, versionlock
Loading support for Red Hat kernel ABI
Setting up Update Process
No Packages marked for Update
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)
解决方案
思路:卸载原有自带的yum,替换成同版本centos的yum
卸载原有自带的yum
rpm -qa | grep yum | xargs rpm -e --nodeps
下载软件包
由于官方源已经无法下载,使用其他源
https://archive.kernel.org/centos-vault/6.8/os/x86_64/Packages/
wget --no-check-certificate https://archive.kernel.org/centos-vault/6.8/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget --no-check-certificate https://archive.kernel.org/centos-vault/6.8/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
wget --no-check-certificate https://archive.kernel.org/centos-vault/6.8/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
wget --no-check-certificate https://archive.kernel.org/centos-vault/6.8/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
安装
# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
# rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm