參考:https://blog.csdn.net/homewm/article/details/80642851
Centos7系統使用yum遇到的問題
查看 yum源資源
cd /etc/yum.repos.d
發現為空;
於是去 更新centos系統的repo文件
http://mirrors.ustc.edu.cn/help/centos.html
查找對應版本的 CentOS-Base.repo 文件:
比如:

選擇對應版本的 /etc/yum.repos.d/CentOS-Base.repo文件, 放入/etc/yum.repos.d/ 操作前請做好相應備份。
拷貝上面這些內容,粘貼到yum.repos.d/CentOS-Base.repo里面。
3)運行以下命令生成緩存
#cd /etc/yum.repos.d
# yum clean all
# yum makecache
就可以了。

