Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or ol

Posted 阿菠萝阿瑶

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or ol相关的知识,希望对你有一定的参考价值。

报错命令

root@ubuntu:/etc/apt# apt-get update
Err:1 http://mirrors.aliyun.com/ubuntu trusty InRelease
  Could not resolve \'mirrors.aliyun.com\'
Err:2 http://mirrors.aliyun.com/ubuntu trusty-backports InRelease
  Could not resolve \'mirrors.aliyun.com\'
Err:3 http://mirrors.aliyun.com/ubuntu trusty-proposed InRelease
  Could not resolve \'mirrors.aliyun.com\'
Err:4 http://mirrors.aliyun.com/ubuntu trusty-security InRelease
  Could not resolve \'mirrors.aliyun.com\'
Err:5 http://mirrors.aliyun.com/ubuntu trusty-updates InRelease
  Could not resolve \'mirrors.aliyun.com\'
Reading package lists... Done
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/trusty/InRelease  Could not resolve \'mirrors.aliyun.com\'
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/trusty-backports/InRelease  Could not resolve \'mirrors.aliyun.com\'
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/trusty-proposed/InRelease  Could not resolve \'mirrors.aliyun.com\'
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/trusty-security/InRelease  Could not resolve \'mirrors.aliyun.com\'
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/trusty-updates/InRelease  Could not resolve \'mirrors.aliyun.com\'
W: Some index files failed to download. They have been ignored, or old ones used instead.

 

报错原因

解析域名不对

 

解决方案

vim /etc/systemd/resolved.conf

dns改成8.8.8.8

 

 

保存,重启机器即可

 

以上是关于Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or ol的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu下出现“无法获得锁”的情况

Ubuntu下gcc安装

ubuntu 14.04 下利用apt-get方式安装opencv

Ubuntu 命令教程全录

Linux发行版 Ubuntu的 apt-get命令

ubuntu 执行apt-get update报错Failed to fetch