运维系列&Ubuntu(亲测有效):apt update时:解决Some index files failed to download.They have been ignored, or old

解决Some index files failed to download.They have been ignored, or old ones used instead报错




本文章向大家介绍解决Some index files failed to download.They have been ignored, or old ones used instead报错,主要包括解决Some index files failed to download.They have been ignored, or old ones used instead报错使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

使用sudo apt-get update后报错:

Err:1 http://ppa.launchpad.net/wireshark-dev/stable/ubuntu bionic InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/wireshark-dev/stable/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.

使用ping www.baidu.com测试一下网络,如果出现:ping: www.baidu.com: Temporary failure in name resolution就是网络问题了,

解决方法

首先

sudo vim /etc/systemd/resolved.conf

修改DNS如下:

[Resolve]
DNS=8.8.8.8
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes

修改下如下配置文件

vim /etc/resolv.conf 

添加如下内容:

nameserver 8.8.8.8

然后重启:

reboot

重启完成后更新一下源就行:

sudo apt-get update







本文来自博客园,作者:木子欢儿,转载请注明原文链接:https://www.cnblogs.com/HGNET/p/15881892.html







码农教程

解决Some index files failed to download.They have been ignored, or old ones used instead报错

  • 7
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
云服务器解决apt报错"E: Some index files failed to download. They have been ignored, or old ones used instead."的方法有两种。方法一是更新apt-get命令的源列表,方法二是更换apt源。 方法一: 更新apt-get源列表 1. 打开终端或SSH连接到你的云服务器。 2. 运行以下命令来备份原有的源列表文件: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 3. 使用文本编辑器打开源列表文件: ``` sudo nano /etc/apt/sources.list ``` 4. 在打开的文件中将原有的源地址替换为以下地址之一(根据你的地理位置选择合适的地址): - 阿里云:http://mirrors.aliyun.com/ubuntu/ - 清华大学:https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ - 中科大:https://mirrors.ustc.edu.*** 保存并关闭文件。 6. 运行以下命令来更新源列表并安装软件包: ``` sudo apt-get update ``` 方法二: 更换apt源 1. 打开终端或SSH连接到你的云服务器。 2. 运行以下命令来备份原有的源列表文件: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 3. 使用文本编辑器打开源列表文件: ``` sudo nano /etc/apt/sources.list ``` 4. 删除原有的源地址,并添加以下地址之一(根据你的地理位置选择合适的地址): - 阿里云:deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse - 清华大学:deb https://mirrors.tuna.tsinghua.edu.***大:deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse - 163镜像源:deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse 5. 保存并关闭文件。 6. 运行以下命令来清空之前下载的索引文件: ``` sudo rm /var/lib/apt/lists/* -vf ``` 7. 运行以下命令来更新源列表并安装软件包: ``` sudo apt-get update ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

坦笑&&life

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值