-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

相关推荐
weixin_307779132 分钟前
Jenkins Folders插件详解:组织、管理与最佳实践
运维·开发语言·自动化·jenkins
raoxiaoya3 分钟前
golang调用 elasticsearch 8,向量检索
开发语言·elasticsearch·golang
爱上妖精的尾巴6 分钟前
6-5 WPS JS宏 集合成员迭代(随机生成试题)
开发语言·前端·javascript
小鸡吃米…14 分钟前
Python PyQt6教程二-第一个工程
开发语言·python
程序媛青青15 分钟前
Java 中 NIO 和IO 的区别
java·开发语言·nio
abcefg_h19 分钟前
GO Web开发详细流程(无框架,restful风格,MVC架构)
开发语言·前端·golang
BullSmall19 分钟前
Shell脚本波浪号避坑指南
linux·bash
@小码农21 分钟前
6547网题库:2025年9月 Python等级考试(四级)真题及答案
开发语言·python
@我本楚狂人23 分钟前
Python MCP实战:构建 FastAPI 服务端与客户端示例&MCP客户端调用
开发语言·python·fastapi