未注册的RedHat无法使用yum源,需更改为CentOS的免费源。
1. 删除所有yum源
rpm -qa|grep yum|xargs rpm -e --nodeps
2. 手动下载yum源
wget http://mirrors.163.com/centos/7.6.1810/os/x86_64/Packages/yum-3.4.3-154.el7.centos.noarch.rpm wget http://mirrors.163.com/centos/7.6.1810/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm wget http://mirrors.163.com/centos/7.6.1810/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget http://mirrors.163.com/centos/7.6.1810/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm
yum源可能因为版本变动而失效,在源网站中查看最新版本,修改加粗部分。
3.安装yum源
rpm -ivh *.rpm
4. 修改.repo文件
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
cd /etc/yum.repos.d/
编辑CentOS7-Base-163.repo文件
将黄色标注部分替换为7.6.1810
5.清除缓存并重新生成缓存
yum clean all
yum makecache
6.尝试安装ftp服务
修改yum源成功
参考资料:
https://blog.csdn.net/otmqixi/article/details/81564515