-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

相关推荐
机灵猫3 分钟前
深入理解 Java 类加载与垃圾回收机制:从原理到实践
java·开发语言
weixin_307779134 分钟前
AWS Redshift 数据仓库完整配置与自动化管理指南
开发语言·数据仓库·python·云计算·aws
伐尘25 分钟前
【Qt】QTableWidget 自定义排序功能实现
开发语言·qt
多多*1 小时前
上传文件相关业务,采用策略模式+模版方法模式进行动态解耦
java·开发语言
hi_link1 小时前
centos系统将/home分区的空间分配给/
linux·运维·centos
赴前尘1 小时前
Go 通道非阻塞发送:优雅地处理“通道已满”的场景
开发语言·后端·golang
weixin_456904272 小时前
以太网与工业以太网通信C#开发
开发语言·c#
野猪亨利6672 小时前
Qt day1
开发语言·数据库·qt
lastHertz2 小时前
Golang 项目中使用 Swagger
开发语言·后端·golang
惜月_treasure2 小时前
LlamaIndex多模态RAG开发实现详解
开发语言·python·机器学习