安装gcc出现错误-----正在尝试其他镜像

安装redis时,需要安装C语言的编译环境
执行yum install gcc 命令时,
出现
Unknown error"ETA
正在尝试其它镜像

http://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/updates/x86_64/Packages/glibc-devel-2.17-324.el7_9.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; Unknown error"
正在尝试其它镜像。
cpp-4.8.5-44.el7.x86_64.rpm    FAILED                                          
http://mirror.lzu.edu.cn/centos/7.9.2009/os/x86_64/Packages/cpp-4.8.5-44.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirror.lzu.edu.cn; Unknown error"ETA 
正在尝试其它镜像。
glibc-devel-2.17-324.el7_9.x86 FAILED                                          
http://mirrors.163.com/centos/7.9.2009/updates/x86_64/Packages/glibc-devel-2.17-324.el7_9.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; Unknown error"
正在尝试其它镜像。
gcc-4.8.5-44.el7.x86_64.rpm    FAILED                                          
http://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/gcc-4.8.5-44.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"A 
正在尝试其它镜像。
gcc-4.8.5-44.el7.x86_64.rpm    FAILED                                          
http://mirrors.huaweicloud.com/centos/7.9.2009/os/x86_64/Packages/gcc-4.8.5-44.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.huaweicloud.com; Unknown error"
正在尝试其它镜像。


Error downloading packages:
  glibc-headers-2.17-324.el7_9.x86_64: [Errno 256] No more mirrors to try.
  gcc-4.8.5-44.el7.x86_64: [Errno 256] No more mirrors to try.
  kernel-headers-3.10.0-1160.36.2.el7.x86_64: [Errno 256] No more mirrors to try.
  glibc-devel-2.17-324.el7_9.x86_64: [Errno 256] No more mirrors to try.
  cpp-4.8.5-44.el7.x86_64: [Errno 256] No more mirrors to try.

[root@RegainGlory-001 redis-5.0.13]# /etc/yum.repos.d/
-bash: /etc/yum.repos.d/: 是一个目录
[root@RegainGlory-001 redis-5.0.13]# cd /etc/yum.repos.d/
[root@RegainGlory-001 yum.repos.d]# ls
CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo  CentOS-x86_64-kernel.repo
[root@RegainGlory-001 yum.repos.d]# rm -rf *.repo
[root@RegainGlory-001 yum.repos.d]# ls
[root@RegainGlory-001 yum.repos.d]# 

需要我们重新配置镜像
命令 cd /etc/yum.repos.d/
命令 ls 可以查看 所有的镜像
命令 rm -rf *.repo 删除全部镜像

然后需要我们重新配置镜像

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

  • 4
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值