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

报错命令

[email protected]:/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

保存,重启机器即可

原文地址:https://www.cnblogs.com/poloyy/p/12683821.html

时间: 2024-10-03 22:32:28

Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.的相关文章

解决node在ubuntu下npm install canvas不断报错的尴尬

项目中需要用到node中一个验证码的npm包:captchagen,此npm包依赖canvas画布npm包.执行npm install canvas时就会报错,错误代码显示文件编译失败.最终在github问答上找到答案: 问题根源是ubuntu中缺少图形开发库,一一安装上问题解决. sudo apt-get install libcario-dev; sudo apt-get install libjpeg-dev; sudo apt-get install libgif-dev; sudo a

【Problem】xampp in ubuntu下命令行启动mysql报错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)

xampp in ubuntu下命令行启动mysql报错: [email protected]:/opt/lampp$ ./bin/mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2) 启动mysql服务: [email protected]:/opt/lampp$ /

在ubuntu更新,E: Some index files failed to download, they have been ignored, or old ones used inst错误

sudo rm /var/lib/apt/lists/* -vf sudo apt-get update

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

在ubuntu下执行sudo apt-get update时,经常会遇到报错: Err http://security.ubuntu.com precise-security InReleaseErr http://security.ubuntu.com precise-security Release.gpg Temporary failure resolving 'security.ubuntu.com'Err http://cn.archive.ubuntu.com precise InR

Ubuntu遇到apt-get update报错:"E: Could not get lock /var/lib/apt/lists/lock"

sudo apt-get update报错:"E: Could not get lock /var/lib/apt/lists/lock" 出现此问题的原因可能是有另外一个程序在运行,导致资源被加锁,不可用.导致资源被锁的原因可能是上次更新源的操作没有完成! 从上图可以看出,报错的内容是不能获取那个路径下的 lock,咱们就应该删除哪个lock. 删除之后再执行 sudo apt-get update 操作,成功! 原文地址:https://www.cnblogs.com/skzxc/

Windows 和 Linux 中的换行与回车的区别,Windows下编写的Shell脚本,直接放到linux/unix下执行会报错

首先: CR(Carriage Return)表示回车 LF(Line Feed)表示换行 Dos和Windows采用回车+换行(CR+LF)表示下一行而UNIX/Linux采用换行符(LF)表示下一行苹果机(MAC OS系统)则采用回车符(CR)表示下一行 Windows下编写的Shell脚本,直接放到linux/unix下执行会报错,就是因为行结束符不一样导致的. 现在好多文本工具都提供了转换功能,如我常用的,也是最强大的工具 (个人感受,不是打广告):notepad++. 原文地址:htt

Linux下安装Nrpe软件相关报错

Linux下面安装nrpe软件时,如果进行配置时(./configure)  报错: 并且执行make all命令进行编译时候也报错: 解决办法:    在报错的服务器上执行yum -y install openssl-devel   命令安装ssl的库 之后再次执行./configure命令进行配置,如果配置成功应该显示如下信息: 再次使用make all 命令就不会报错了.make all完毕显示如下信息: Linux下安装Nrpe软件相关报错,布布扣,bubuko.com

linux下编译安装php各种报错大集合

PHP开源脚本语言 PHP(外文名: Hypertext Preprocessor,中文名:"超文本预处理器")是一种通用开源脚本语言.语法吸收了C语言.Java和Perl的特点,入门门槛较低,易于学习,使用广泛,主要适用于Web开发领域.PHP的文件后缀名为php. 本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下. 报错1:make 后报错如下: Generating phar.php /home/oldboy/tools/php-5.3.27

Linux/ubuntu下的boost库安装

我一直都没有写博客的习惯,最近正好在研究linux下的开发(目前也只是粗粗的研究),且用到了boost库,就乘此机会写点什么,最起码记录一下我在安装boost的一些步骤,主要给和我一样的linux开发新手们提供点借鉴(当然如果看到这篇文档的话 ),作者(jwybobo2007). 1.下载boost库 这个我就不说啥了,去官网看一下就能下到:www.boost.org ,现在的版本更新到了1.44 2.执行:sudo apt-get install build-essential 不为别的,就是