-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

相关推荐
z落落5 小时前
C# 泛型方法(原理、类型推断、多泛型参数)+泛型效率(普通类型 VS Object装箱 VS 泛型)
开发语言·c#
L_09075 小时前
【C++】异常
开发语言·c++
世辰辰辰6 小时前
批量修改图片/文本名子
开发语言·python·批量修改文件名
z落落8 小时前
C# 四种特殊类:抽象类、密封类、静态类、部分类
开发语言·c#
VidDown9 小时前
Webhook 调试器:让第三方回调“原形毕露”
java·开发语言·javascript·编辑器·postman
装不满的克莱因瓶9 小时前
基于 OpenResty 扩展开发实现动态服务注册与发现能力
java·开发语言·架构·openresty
weixin_5231853210 小时前
Java基础知识总结(四):引用数据类型与参数传递机制
java·开发语言·python
Nayxxu10 小时前
Claude API 生产稳定性设计:超时、降级、备用模型和告警怎么做
开发语言·php
王cb10 小时前
WinRT Server and Client c#
开发语言·c#
Selina K10 小时前
C中日历时间转换
c语言·开发语言