«

centos 7 出现Error: requested datatype primary not available

TLYAN 发布于 阅读:1970 学习分享


我在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.repocurl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.reposed -i '/aliyuncs/d' /etc/yum.repos.d/CentOS-Base.repo
yum makecache fast
ll /etc/yum.repos.d/

成功解决了问题