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

  • Post author:
  • Post category:其他


安装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



版权声明:本文为hhtSeeTheWorld原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。