-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

相关推荐
共享家952715 分钟前
Java入门(多态)
java·开发语言
机器视觉知识推荐、就业指导16 分钟前
拆 Qt,为什么要先引入libmodbus?
开发语言·qt
2401_8578652316 分钟前
C++模块接口设计
开发语言·c++·算法
蓝莓星冰乐24 分钟前
第一章:C语言概述与环境搭建
c语言·开发语言
add45a27 分钟前
嵌入式C++低功耗设计
开发语言·c++·算法
毕设源码-赖学姐29 分钟前
【开题答辩全过程】以 基于Java的婚礼策划平台的设计与实现为例,包含答辩的问题和答案
java·开发语言
2401_8747325336 分钟前
C++中的状态模式
开发语言·c++·算法
m0_716667071 小时前
实时数据压缩库
开发语言·c++·算法
dapeng28701 小时前
多协议网络库设计
开发语言·c++·算法
浅浅的小草1 小时前
APM使用LUA脚本发送实现遥控器PWM信号输出CAN协议信号
开发语言·apm