Linux中yum执行yum -y install gcc 报错 解决方案

Linux中yum执行yum -y install gcc 报错 解决方案

本人实际遇到的问题,已亲测正式环境,为防止下次在遇到,在这里做个记录,遇到此问题的小伙伴可以参考此文章.
文章摘自其它网友博客(无任何商业用途)
正文如下-------

一. Linux执行命令:yum -y install gcc
二. 报错详情:

Loaded plugins: fastestmirror Loading mirror speeds from cached
hostfile There are no enabled repos. Run “yum repolist all” to see
the repos you have. To enable Red Hat Subscription Management
repositories:
subscription-manager repos --enable To enable custom repositories:
yum-config-manager --enable

三,解决方法步骤:
1:首先还是最简单的,先看你的网络有没有通(ping www.baidu.com)
没有的话,移步这篇博客 https://www.cnblogs.com/xuzhaoyang/p/11239145.html
2:将yum源换成国内源(例:修改yum源,在安装更新rpm包时获得比较理想的速度。国内比较快的有163源、sohu源。这里以163源为例子)
相关执行命令:

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
mv CentOS6-Base-163.repo CentOS-Base.repo
yum clean all

最后在使用yum就可以了

上一篇:centos7安装k8s的kubectl、Kubelet、kubeadm等工具


下一篇:yum报错总结