当前位置:首页 » 《随便一记》 » 正文

Ubuntu报错E: Failed to fetch http://mirrors.cloud.aliyuncs.com解决方案

15 人参与  2024年10月01日 16:40  分类 : 《随便一记》  评论

点击全文阅读


报错内容:

在进行更新源和下载工具包时都会报错类似以下内容:
Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/nginx-common_1.18.0-6ubuntu14.4_all.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/libnginx-mod-http-geoip2_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/libnginx-mod-http-image-filter_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/libnginx-mod-http-xslt-filter_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/libnginx-mod-mail_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/libnginx-mod-stream_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/libnginx-mod-stream-geoip2_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/nginx-core_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu-ports/pool/main/n/nginx/nginx_1.18.0-6ubuntu14.4_arm64.deb Could not resolve ‘mirrors.cloud.aliyuncs.com’
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

寻求方法:

报错提示无法解析阿里云镜像链接,在网上找了很多解决方案,主要指出两个问题:
1.DNS解析问题
添加了以下DNS依然存在问题
在这里插入图片描述

2.镜像源问题
修改成国内镜像源依然没有解决

最终解决

发现我的问题是DNS解析问题
阿里云的DNS是127.0.0.53,我添加的是127.0.0.253
修改后解决

1.打开并修改配置文件

sudo vi /etc/resolv.conf

2.在文件中添加阿里云DNS(按i进入编辑模式,添加后esc退出编辑模式,输入:wq保存并退出)

nameserver 127.0.0.53

在这里插入图片描述


点击全文阅读


本文链接:http://zhangshiyu.com/post/166982.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1