debian8 的 APT 源无法使用了吗?

最近好像发现 debian8 的 apt 源好像无法访问了?貌似是从上周开始的

使用 apt update 更新会报错 404

╰─➤  docker run --rm -it debian:jessie bash                                                                                                                                                                                                                                                    130 ↵
root@2092197dbb45:/# apt update
Ign http://deb.debian.org jessie InRelease
Ign http://deb.debian.org jessie-updates InRelease
Ign http://security.debian.org jessie/updates InRelease
Ign http://deb.debian.org jessie Release.gpg
Ign http://deb.debian.org jessie-updates Release.gpg
Ign http://deb.debian.org jessie Release
Ign http://deb.debian.org jessie-updates Release
Ign http://security.debian.org jessie/updates Release.gpg
Ign http://security.debian.org jessie/updates Release
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://deb.debian.org jessie/main amd64 Packages
  404  Not Found
Err http://deb.debian.org jessie-updates/main amd64 Packages
  404  Not Found
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://security.debian.org jessie/updates/main amd64 Packages
  404  Not Found [IP: 151.101.194.132 80]
W: Failed to fetch http://deb.debian.org/debian/dists/jessie/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.194.132 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
阅读 5.3k
3 个回答

debian和ubuntu一样,会把不再维护的仓库挪到 http://archive.debian.org/debian/进行归档,并且不再有任何更新,你仍然需要使用旧版本的仓库需要改到这个仓库地址下

使用 docker run --rm -it debian:jessie bash 进去之后,查看一下 /etc/apt/sources.list 文件内容

# deb http://snapshot.debian.org/archive/debian/20210326T030000Z jessie main
deb http://deb.debian.org/debian jessie main
# deb http://snapshot.debian.org/archive/debian-security/20210326T030000Z jessie/updates main
deb http://security.debian.org/debian-security jessie/updates main
# deb http://snapshot.debian.org/archive/debian/20210326T030000Z jessie-updates main
deb http://deb.debian.org/debian jessie-updates main

发现有注释内容,就是 http://snapshot.debian.org/archive/debian/20210326T030000Z

所以,应该可以用

但是 docker 的 debian8 还是不带 vim 的,所以我用 echo "deb http://snapshot.debian.org/archive/debian/20210326T030000Z jessie main" > /etc/apt/sources.list 覆盖写入

root@f87fe1fe9843:/# cat /etc/apt/sources.list
deb http://snapshot.debian.org/archive/debian/20210326T030000Z jessie main

有一个就够了

apt update 一下

root@f87fe1fe9843:/# apt update
Ign http://snapshot.debian.org jessie InRelease
Get:1 http://snapshot.debian.org jessie Release.gpg [1652 B]
Get:2 http://snapshot.debian.org jessie Release [77.3 kB]
Ign http://snapshot.debian.org jessie Release                                                                                                                                                                                                                                                                
Get:3 http://snapshot.debian.org jessie/main amd64 Packages [9098 kB]                                                                                                                                                                                                                                        
Fetched 9177 kB in 37s (243 kB/s)                                                                                                                                                                                                                                                                            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: GPG error: http://snapshot.debian.org jessie Release: The following signatures were invalid: KEYEXPIRED 1668891673

可以看到有报错,但是这个报错不重要

安装一个 vim 看看

root@f87fe1fe9843:/# apt install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libgpm2 vim-common vim-runtime
Suggested packages:
  gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
  libgpm2 vim vim-common vim-runtime
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 6219 kB of archives.
After this operation, 28.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] ^C

可以安装,没毛病

现在都debian12了,版本更新吧。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题