Debian apt-get 更新不起作用

Debian apt-get 更新不起作用

我有一台 Debian 机器 ( Linux debian 2.6.32-5-amd64 #1 SMP Fri Feb 15 15:39:52 UTC 2013 x86_64 GNU/Linux),它在 NAT 后面运行,其中几个端口已转发用于 SSH 和 Web。我可以正常访问 Web,也可以正常进行 DNS 查找。

我的 sources.list 的内容

deb http://ftp.br.debian.org/debian squeeze main
deb-src http://ftp.br.debian.org/debian squeeze main

deb http://ftp.br.debian.org/debian squeeze-updates main
deb-src http://ftp.br.debian.org/debian squeeze-updates main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

当我尝试 apt-get update 时,我得到以下信息

Ign http://security.debian.org squeeze/updates Release.gpg
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_GB
Ign http://security.debian.org squeeze/updates Release
Err http://security.debian.org squeeze/updates/main Sources
404  Not Found [IP: 195.20.242.89 80]
Err http://security.debian.org squeeze/updates/main amd64 Packages
404  Not Found [IP: 195.20.242.89 80]
Ign http://ftp.br.debian.org squeeze Release.gpg    
Ign http://ftp.br.debian.org/debian/ squeeze/main Translation-en
Ign http://ftp.br.debian.org/debian/ squeeze/main Translation-en_GB
Ign http://ftp.br.debian.org squeeze-updates Release.gpg
Ign http://ftp.br.debian.org/debian/ squeeze-updates/main Translation-en
Ign http://ftp.br.debian.org/debian/ squeeze-updates/main Translation-en_GB
Ign http://ftp.br.debian.org squeeze Release
I    gn http://ftp.br.debian.org squeeze-updates Release
Err http://ftp.br.debian.org squeeze/main Sources
404  Not Found [IP: 200.236.31.3 80]
Err http://ftp.br.debian.org squeeze/main amd64 Packages
404  Not Found [IP: 200.236.31.3 80]
Err http://ftp.br.debian.org squeeze-updates/main Sources
404  Not Found [IP: 200.236.31.3 80]
Err http://ftp.br.debian.org squeeze-updates/main amd64 Packages
404  Not Found [IP: 200.236.31.3 80]
W: Failed to fetch http://security.debian.org/dists/squeeze/updates/main/source/Sources.gz  404  Not Found [IP: 195.20.242.89 80]    
W: Failed to fetch http://security.debian.org/dists/squeeze/updates/main/binary-amd64/Packages.gz  404  Not Found [IP: 195.20.242.89 80]
W: Failed to fetch http://ftp.br.debian.org/debian/dists/squeeze/main/source/Sources.gz  404  Not Found [IP: 200.236.31.3 80]
W: Failed to fetch http://ftp.br.debian.org/debian/dists/squeeze/main/binary-amd64/Packages.gz  404  Not Found [IP: 200.236.31.3 80]
W: Failed to fetch http://ftp.br.debian.org/debian/dists/squeeze-updates/main/source/Sources.gz  404  Not Found [IP: 200.236.31.3 80]
W: Failed to fetch http://ftp.br.debian.org/debian/dists/squeeze-updates/main/binary-amd64/Packages.gz  404  Not Found [IP: 200.236.31.3 80]
E: Some index files failed to download, they have been ignored, or old ones used instead.

答案1

镜像服务器或镜像服务器与您的机器之间的网络连接似乎存在一些问题。请查看以下内容Debian 源代码生成器获取适合您的版本、存储库和国家/地区的默认源。

答案2

现在,Debian 6 (squeeze) 已于 2016 年进入 EOL(生命周期结束)阶段,用户需要面对额外的麻烦,即寻找正确的存档链接。httpredir 域无法帮助找到它。我做了一些挖掘,最终找到了一种模式,可以帮助我更新 Debian 6 docker 容器。

# debian 6 - squeeze now relegated to old archive repos
RUN echo 'Acquire::Check-Valid-Until "false";' >/etc/apt/apt.conf.d/90ignore-release-date
RUN echo "deb http://archive.debian.org/debian-archive/debian squeeze main" > /etc/apt/sources.list
RUN echo "deb http://archive.debian.org/debian-archive/debian squeeze-proposed-updates main" >> /etc/apt/sources.list
RUN echo "deb http://security.debian.org squeeze/updates main" >> /etc/apt/sources.list
RUN echo "deb http://archive.debian.org/debian-archive/debian squeeze-lts main contrib non-free" >> /etc/apt/sources.list

(如果在 shell 上输入,请删除 RUN 部分)

必须将 Check-Valid-Until 标志设置为 false,因为存档 squeeze-lts 发行版现在已超过默认最大使用期限,否则将无法加载。(来源:Heisenberg -https://stackoverflow.com/questions/36080756/archive-repository-for-debian-squeeze

相关内容