一、现象:
新装的测试机器,yum安装软件报错。
[root@center7-sz01 ~]# yum update
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: hkg.mirror.rackspace.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
二、处理问题:
重新安装 yum
访问:
http://centos.ustc.edu.cn/centos
然后根据自己的centos 版本选择
例如我的是:CentOS Linux release 7.8.2003
访问 http://centos.ustc.edu.cn/centos/7.8.2003/os/x86_64/Packages/
需要下载:
yum-3.4.3-167.el7.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
下载方式:
wget http://centos.ustc.edu.cn/centos/7.8.2003/os/x86_64/Packages/yum-3.4.3-167.el7.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/7.8.2003/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
wget http://centos.ustc.edu.cn/centos/7.8.2003/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
安装:
rpm -ivh *.rpm
下载yum的配置源:
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo //下载到 /etc/yum.repos.d/ 目录下面
运行yum makecache 生成缓存