Centos yum报错‘Connection timed out after 30002 milliseconds‘) 正在尝试其它镜像。解决办法

修改源后更新报错
我有两个Centos 一个7 一个8,疏忽在7上面配置了8的源后报错,通过下面的报错发现提示的是Centos7的源找不到,才意识到是不是配置错了源。

报错信息:

http://mirrors.aliyun.com/centos/7/AppStream/x86_64/os/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
正在尝试其它镜像。
To address this issue please refer to the below wiki article 

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

http://mirrors.cloud.aliyuncs.com/centos/7/AppStream/x86_64/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyuncs.com/centos/7/AppStream/x86_64/os/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/7/AppStream/x86_64/os/repodata/repomd.xml: (28, 'Connection timed out after 30002 milliseconds')
正在尝试其它镜像。

在这里插入图片描述

查看Centos的版本

cat /etc/centos-release

在这里插入图片描述
可以看到自己使用的是7

备份源文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak

下载7的源文件

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

如果没有安装wget 不能下载,需要在浏览器中下载源文件上传到/etc/yum.repos.d/目录下
如果你的是8的把命令Centos-7.repo改为Centos-8.repo即可。
在这里插入图片描述

加载缓存

yum makecache

在这里插入图片描述
再次运行更新命令即可恢复
在这里插入图片描述

相关推荐

  1. React 项目解决办法收录

    2024-03-18 10:38:01       43 阅读
  2. npm installERR code ETIMEDOUT的解决办法

    2024-03-18 10:38:01       60 阅读
  3. Vivado Synth8-5535 解决办法

    2024-03-18 10:38:01       58 阅读
  4. Ubuntu中rosdep update解决办法

    2024-03-18 10:38:01       50 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-18 10:38:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-18 10:38:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-18 10:38:01       82 阅读
  4. Python语言-面向对象

    2024-03-18 10:38:01       91 阅读

热门阅读

  1. Linux 16个常用脚本(初级)练习

    2024-03-18 10:38:01       38 阅读
  2. 蓝桥杯(3.15 刷真题)

    2024-03-18 10:38:01       46 阅读
  3. K8S--为什么要用K8S,它有哪些功能?

    2024-03-18 10:38:01       40 阅读
  4. 计算机网络的功能和特点

    2024-03-18 10:38:01       53 阅读
  5. C 练习实例80-猴子分桃

    2024-03-18 10:38:01       37 阅读
  6. 深入理解Telnet协议:远程登录的标准

    2024-03-18 10:38:01       39 阅读
  7. CAA审核员考试历年真题练习题汇总

    2024-03-18 10:38:01       46 阅读