centos 7 出现Error: requested datatype primary not available

我在centos 7 安装插件的时候出现了以上的问题,然后就通过百度等办法查找相关的解决方案,大多数都是一样的答案,就是这边复制到那边的而已。就是一下的方案
解决方式:
[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost ~]# sudo rpm --rebuilddb

但是我在经过多次的尝试之后还是没有办法解决我出现的问题。后面怀疑会不会是源的问题,然后我就尝试更换阿里云的源,最终解决了上面出现的问题

mv /etc/yum.repos.d/* /tmp/
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
sed -i '/aliyuncs/d' /etc/yum.repos.d/CentOS-Base.repo
yum makecache fast
ll /etc/yum.repos.d/

 

posted @ 2023-02-28 16:47  杰尔克  阅读(1215)  评论(0编辑  收藏  举报