

Debian更新源时发生两个错误
source link: https://note.qidong.name/2017/06/26/debian-apt-source-errors/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Debian更新源时发生两个错误
2017-06-26 17:42:13 +08 字数:554 标签: Linux
今日,孤在Debian上执行sudo apt-get update
时发生两个问题。
问题一 ¶
现象 ¶
E: Some index files failed to download. They have been ignored, or old ones used instead.
这个错误,通常伴随着一些形如下面的警告:
W: Failed to fetch http://…/ 404 Not Found [IP: xxx.x.x.xxx 80]
原因 ¶
更新源时,如果出问题,通常会有两种可能。
- 新源有问题,或部分版本无法访问。比如,无法访问Scretch,但能访问Jessie。
- 原先的一些自增源,年久失修,无法访问。比如,
http://ppa.launchpad.net/*
里的源。
解决方案 ¶
针对上述第一种情况,换源时,推荐使用apt-spy
。
apt-spy
会根据参数,对指定区域内的源进行测速,
并且把推荐的源写在/etc/apt/sources.list.d/apt-spy.list
中。
以下在亚洲,对stable源进行测速,时限3秒。
sudo apt-spy -d stable -s asia -t 3
sudo cp /etc/apt/sources.list.d/apt-spy.list /etc/apt/sources.list
这样通常可以解决第一个问题。
如果还是不行,使用ftp://ftp.cn.debian.org/debian/
,
往往是中国区的默认方案,速度普通,胜在稳定。
针对第二种情况,需要把一些不用的、一次性的源删除。
如果没有需要保留的自增源,可以直接删除全部。
sudo rm -rf /etc/apt/sources.list.d/*
再次使用apt-get update
更新即可。
问题二 ¶
现象 ¶
W: There is no public key available for the following key IDs:
原因 ¶
错误的key,或者老旧的keyring版本。
解决方案 ¶
sudo apt-get install debian-keyring debian-archive-keyring
sudo apt-key update
sudo apt-get update
Recommend
-
9
修改 Ubuntu 软件更新源¶ 由于设置原因又或者用...
-
17
mac-“准备安装时发生错误,请尝试重新运行此应用程序”,最新办法解决 Published 2020年7月15日
-
18
最近由于在技改,发生了不少问题,前文中说的缓存穿透只是其中之一,想了想,虽然都是比较简单的问题,但是应该实际中还是有不少人碰到过...
-
10
记一次最近生产环境项目中发生的两个事故及处理方法 年前放假的...
-
7
Kali Linux 之软件安装、卸载、更新和修改更新源 date_range 21/04/2018 00:00点击...
-
4
Centos 更新源,升级程序Tuesday, April 2nd 2019, 7:16:11 am ( ISO 8601 )Linux 服务器有的初始化软件版本过低,经常面临软件更新、安全问题,我们该如何更新软件呢? 备份 CentOS-Base.repo mv /...
-
16
Debian更新源时出现签名无法进行验证 发表于 2022-01-01 更新于 2022-01-...
-
6
kali更新源数字签名错误解决办法 apt-get update更新时...
-
9
【笔记】更换 Ubuntu Linux 更新源 2023-12-12 2023-12-13...
-
12
【笔记】更换 OpenWRT 更新源 2023-12-24 3 ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK