-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

相关推荐
烈风1 分钟前
01_Tauri环境搭建
开发语言·前端·后端
cch89182 分钟前
PHP爬虫框架大比拼
开发语言·爬虫·php
l1t8 分钟前
DeepSeek辅助编写的dmp转schema和csv文件c语言程序
c语言·开发语言·windows
DREW_Smile14 分钟前
自定义类型:联合体和枚举
c语言·开发语言
女王大人万岁18 分钟前
Golang实战gRPC与Protobuf:从入门到进阶
服务器·开发语言·后端·qt·golang
时寒的笔记20 分钟前
js基础05_js类、原型对象、原型链&案例(解决无限debugger)
开发语言·javascript·原型模式
人间打气筒(Ada)21 分钟前
「码动四季·开源同行」go语言:如何使用 ELK 进行日志采集以及统一处理?
开发语言·分布式·elk·go·日志收集·分布式日志系统
波波00725 分钟前
每日一题:C#中using的三种用法
开发语言·c#
游乐码26 分钟前
c#万物之父
开发语言·c#
xiaoshuaishuai830 分钟前
C# Chrome安全机制解析
开发语言·visualstudio·c#