-bash gcc command not found解决方案(CentOS操作系统)

CentOS7 为例,执行以下语句 :

bash 复制代码
yum install gcc

如果下载不成功,并且网络没有问题。

执行以下语句 :

bash 复制代码
cp -r /etc/yum.repos.d /etc/yum.repos.d.bak

rm -f /etc/yum.repos.d/*.repo

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all

yum makecache

yum update

然后检查 yum 源速度 :

bash 复制代码
yum repolist

出现以下就没有问题了

textile 复制代码
yum repolist                                                            
已加载插件:fastestmirror                                                                 
Loading mirror speeds from cached hostfile                                                
 * base: mirrors.aliyun.com                                                               
 * extras: mirrors.aliyun.com                                                             
 * updates: mirrors.aliyun.com                                                            
源标识                        源名称                                                状态  
base/7/x86_64                 CentOS-7 - Base - mirrors.aliyun.com                  10,072
extras/7/x86_64               CentOS-7 - Extras - mirrors.aliyun.com                   526
updates/7/x86_64              CentOS-7 - Updates - mirrors.aliyun.com                6,173
repolist: 16,771                      

在配置一下下面的

bash 复制代码
1、直接关闭防火墙
systemctl stop firewalld

2、禁止firewall开机启动
systemctl disable firewalld

3、查看状态
systemctl status firewalld #出现dead表示关闭成功

11.关闭selinux

参考自 :

https://blog.csdn.net/2402_86403828/article/details/142065102

相关推荐
赵杰伦cpp14 分钟前
C++的继承机制精讲
java·开发语言·c++·后端
半梦半醒*31 分钟前
ELK1——elasticsearch
linux·运维·数据仓库·elasticsearch·centos
百花~43 分钟前
JVM(Java虚拟机)~
java·开发语言·jvm
沐苏瑶1 小时前
PHP反序列化漏洞
java·开发语言
Chloe_lll1 小时前
threejs(七)PBR材质
开发语言·javascript·材质
zh_xuan1 小时前
c++ stringstream字符串流的用法
开发语言·c++
小王不爱笑1321 小时前
Java 核心知识点查漏补缺(二)
java·开发语言
Lacrimosa&L1 小时前
OS_2 进程与线程(进程管理)
java·开发语言
zzywxc7872 小时前
解锁 Rust 开发新可能:从系统内核到 Web 前端的全栈革命
开发语言·前端·python·单片机·嵌入式硬件·rust·scikit-learn
大雨淅淅2 小时前
【编程语言】Rust 入门
开发语言·后端·rust