Failed to fetch http://mirrors.cloud.aliyuncs.com/

news/2024/6/29 2:56:12

服务器版本:阿里云 ubuntu 16.04

问题:
阿里云安装软件时,提示

W: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/dists/xenial/InRelea                                                 se  Could not resolve 'mirrors.cloud.aliyuncs.com'
W: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/dists/xenial-updates                                                 /InRelease  Could not resolve 'mirrors.cloud.aliyuncs.com'
W: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/dists/xenial-securit                                                 y/InRelease  Could not resolve 'mirrors.cloud.aliyuncs.com'
W: Some index files failed to download. They have been ignored, or old ones used                                                  instead.

clipboard.png

先给出正确的解决方案,再告诉大家,我怎么分析的

 cd /etc/apt/sources.list.dcp sources-aliyun-0.list sources-aliyun-0.list.bak   # 保留原版本以防改错

将 sources-aliyun-0.list 内的内容替换成以下内容

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner

修改完毕执行

apt-get update  # 更新源

到此,问题解决。

回顾解决过程
1、从百度和goole尚搜索,大多指向的是dns解析问题。
比如让我修改 dns 配置文件

vim /etc/resolvconf/resolv.conf.d/base

增加 2个dns解析

nameserver 8.8.8.8
nameserver 8.8.4.4

修改完毕后,执行命令

resolvconf -u

添加了dns 其实还是不行,原因就是,错误提示的网址根本没法访问。

知道了问题出在哪里,那我们就可以根据问题来解决
2、百度搜索 阿里云更换 apt-get 源。
搜索后,就出现了,文章开头的解决方案啦!


http://lihuaxi.xjx100.cn/news/237205.html

相关文章

区块链技术概述

链客,专为开发者而生,有问必答! 此文章来自区块链技术社区,未经允许拒绝转载。 区块链技术概述 现状 区块链是随着比特币等数字加密货币的日益普及而逐渐兴起的一种全新的去中心化基础架构与分布式计算范式, 目 前已经引起政府…

寻找隐形冠军 支付宝、微信用得那么溜,可谁知道背后有一名“上海功臣

下午三点半,离晚饭时间还有一段时间,可新沪路上的熟食店“尚老居”门口已经人头攒动。 “阿姨你来啦,今天要点什么?” “老样子,称点烧鹅和蹄髈,阿拉孙子老欢喜吃的,买好正好去接伊放学。” “阿…

主键SQL教程–如何在数据库中定义主键

Every great story starts with an identity crisis. Luke, the great Jedi Master, begins unsure - "Who am I?" - and how could I be anyone important? It takes Yoda, the one with the Force, to teach him how to harness his powers.每个伟大的故事都始于…

css一个很好用的hover显示

之前一直想在样式实现,hover时显示其他div,今天终于找到了,(*^▽^*).a悬停时显示.b.a:hover .b {display: block;}转载于:https://www.cnblogs.com/HCXiao/p/8677713.html

区块链是互联网未来十年中举足轻重的技术

链客,专为开发者而生,有问必答! 此文章来自区块链技术社区,未经允许拒绝转载。 区块链是互联网未来十年中举足轻重的技术 区块链(Blockchain),或者说分布式账本(DLT, Distributed …

Python基础之逻辑运算符

1.在没有()的情况下&#xff0c;not的优先级高于and&#xff0c;and的优先级高于or&#xff0c;即优先级关系为()>not>and>or&#xff0c;同一优先级从左往右计算。 例题&#xff0c;判断下列逻辑语句的结果&#xff1a; 3 > 4 or 4 < 3 and 1 1 1 < 2 a…

区块链:起源、原理及应用

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 近年来&#xff0c;区块链技术正在经历快速发展&#xff0c;并吸引了超过10亿美元的投资规模。而我们认为&#xff0c;最值得重视的是&#xff0c;区…

dubbo学习过程、使用经验分享及实现原理简单介绍

一、前言部门去年年中开始各种改造&#xff0c;第一步是模块服务化&#xff0c;这边初选dubbo试用在一些非重要模块上&#xff0c;慢慢引入到一些稍微重要的功能上&#xff0c;半年时间&#xff0c;学习过程及线上使用遇到的些问题在此总结下。整理这篇文章差不多花了两天半时间…