为什么我的Docker容器没有'apt-get update'-404

cwdobuhd  于 10个月前  发布在  Docker
关注(0)|答案(1)|浏览(108)

我使用的是php:5.5.38-apache docker镜像。
当我远程进入它,并运行apt-get update时,它似乎无法访问repos:

# apt-get update
Ign http://security.debian.org jessie/updates InRelease
Ign http://security.debian.org jessie/updates Release.gpg
Ign http://httpredir.debian.org jessie InRelease
Ign http://security.debian.org jessie/updates Release
Ign http://httpredir.debian.org jessie-updates InRelease
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://httpredir.debian.org jessie Release.gpg
Ign http://httpredir.debian.org jessie-updates Release.gpg
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://httpredir.debian.org jessie Release
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://httpredir.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
  404  Not Found [IP: 151.101.130.132 80]
Err http://httpredir.debian.org jessie/main amd64 Packages
  404  Not Found
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
  404  Not Found
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.130.132 80]

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

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

E: Some index files failed to download. They have been ignored, or old ones used instead.

字符串
怎么了?网络连接似乎没问题:

# ping google.com
PING google.com (142.250.187.206): 56 data bytes
64 bytes from 142.250.187.206: icmp_seq=0 ttl=37 time=58.393 ms
64 bytes from 142.250.187.206: icmp_seq=1 ttl=37 time=22.499 ms
64 bytes from 142.250.187.206: icmp_seq=2 ttl=37 time=21.658 ms
...

x4shl7ld

x4shl7ld1#

这就是为什么:
我使用的是php:5.5.38-apache docker镜像。
PHP 5.5是古老的。它在2016年7月21日达到end of life
它太旧了,以至于Docker镜像使用的Debian版本(Jessie)也不受支持:
杰西还受益于长期支持(LTS),直到2020年6月底。
你会得到404错误,因为那个版本的Debian已经从apt仓库中删除了它的软件包。
PHP的最老版本是8.0,但即使是8.0也只是用于安全修复。
您应该升级到PHP 8.2,这是PHP的最新版本。
如果这是一个现有的项目,那么这可能是一个相当大的工作量,因为你已经忽略了必要的维护(即进行增量升级)在过去的十年。

相关问题