Failed to fetch https://mirrors.ustc.edu.cn/debian/pol/main/g/gnupg2/dirmngr 2.1.18-8-deb9u4 armhf.deb 404 Not FoundE: E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing
时间: 2023-12-12 16:05:20 浏览: 164
这个错误提示是在使用apt-get命令更新软件包时出现的,错误提示显示无法下载gnupg2软件包中的dirmngr文件。这可能是由于您使用的软件源已经过期或者该软件源没有该软件包。您可以尝试使用以下命令来更新软件源并修复缺失的软件包:
sudo apt-get update --fix-missing
如果这个方法不能解决问题,您可以尝试更改软件源并重新运行更新命令。
相关问题
Err http://mirrors.ustc.edu.cn jessie/main amd64 Packages 404 Not Found [IP: 202.141.176.110 80] Err http://mirrors.ustc.edu.cn jessie/updates/main amd64 Packages 404 Not Found [IP: 202.141.176.110 80] Err http://mirrors.ustc.edu.cn jessie-updates/main amd64 Packages 404 Not Found [IP: 202.141.176.110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian-archive/debian/dists/jessie/main/binary-amd64/Packages 404 Not Found [IP: 202.141.176.110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian-archive/debian-security/debian-security/dists/jessie/updates/main/binary-amd64/Packages 404 Not Found [IP: 202.141.176.110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian-archive/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found [IP: 202.141.176.110 80] E: Some index files failed to download. They have been ignored, or old ones used instead. 依旧报错
<think>我们正在解决一个关于在DebianJessie系统中使用USTC镜像源出现404错误的问题。根据之前的分析,这是因为Debian Jessie已经结束支持,被移到了归档仓库。用户提供的引用[1]中提到了使用163镜像源,但同样需要调整到归档路径。解决方案的核心:将源地址切换到USTC镜像站的归档路径(debian-archive)或使用其他镜像的归档路径。具体步骤:1.修改`/etc/apt/sources.list`文件,将原有的USTC镜像源地址替换为USTC的归档地址:-主仓库:`http://mirrors.ustc.edu.cn/debian-archive/debian/`-安全更新仓库:`http://mirrors.ustc.edu.cn/debian-archive/debian-security/`2.修改后的sources.list内容示例(针对Jessie):```debhttp://mirrors.ustc.edu.cn/debian-archive/debian/jessie maindebhttp://mirrors.ustc.edu.cn/debian-archive/debian-security/ jessie/updates main```3.如果使用其他镜像源(如163),同样需要找到其归档路径。但根据引用[1]中的内容,用户提供的163源并没有使用归档路径,所以同样会出现404。因此,我们需要将163的源也改为归档路径,例如:```debhttp://mirrors.163.com/debian-archive/debian/jessie mainnon-freecontribdebhttp://mirrors.163.com/debian-archive/debian-security/ jessie/updates mainnon-freecontrib```注意:需要确认163镜像站是否提供debian-archive路径,如果没有,则不能使用。4.在Dockerfile中的修改方法(以USTC为例):```dockerfileRUN sed-i's|http://mirrors.ustc.edu.cn/debian|http://mirrors.ustc.edu.cn/debian-archive/debian|g' /etc/apt/sources.list&& \sed-i's|http://security.debian.org|http://mirrors.ustc.edu.cn/debian-archive/debian-security|g' /etc/apt/sources.list```5.如果上述方法无效,还可以考虑使用Debian官方归档站点(archive.debian.org):```dockerfileRUNecho "deb http://archive.debian.org/debian jessiemain"> /etc/apt/sources.list&& \echo"debhttp://archive.debian.org/debian-security jessie/updates main" >>/etc/apt/sources.list```6.注意:使用归档站点时,可能需要添加`--allow-unauthenticated`选项来忽略签名验证,因为归档仓库的签名可能已过期。7.在Dockerfile中安装软件时,如果遇到签名问题,可以暂时允许不验证:```dockerfileRUNapt-getupdate -o Acquire::Check-Valid-Until=false-oAcquire::AllowInsecureRepositories=true &&\DEBIAN_FRONTEND=noninteractiveapt-getinstall --allow-unauthenticated-y...```8.验证:修改后运行`apt-get update`,观察是否还有404错误。下面是一个完整的Dockerfile示例(使用USTC归档镜像):```dockerfileFROMdebian:jessie#修复镜像源RUNsed -i 's|http://deb.debian.org/debian|http://mirrors.ustc.edu.cn/debian-archive/debian|g' /etc/apt/sources.list&& \sed-i's|http://security.debian.org|http://mirrors.ustc.edu.cn/debian-archive/debian-security|g' /etc/apt/sources.list#安装软件(允许不安全的仓库和过期的仓库)RUNapt-getupdate -o Acquire::Check-Valid-Until=false &&\DEBIAN_FRONTEND=noninteractive apt-get install-y\wget apache2php5gccmake \&&apt-getclean &&rm -rf /var/lib/apt/lists/*#后续步骤...```注意:由于Jessie已经非常老旧,安装软件时可能会遇到依赖问题,需要具体问题具体分析。如果用户不是在Docker中,而是在实体机或虚拟机中,则直接修改`/etc/apt/sources.list`文件,内容同上。生成相关问题:1.如何确认一个Debian版本是否还在支持周期内?2.除了USTC,还有哪些国内镜像站提供Debian归档仓库?3.在Dockerfile中如何跳过APT的签名验证?4.如何为ProFTPd漏洞环境(CVE-2015-3306)安装特定版本的软件包?5.当使用归档仓库时,遇到“Release fileexpired”错误该如何解决?</think>### 解决 Debian Jessie 使用 USTC 镜像源报错 404 的方法
您遇到的 404 错误是由于 Debian Jessie(8.x)已在 2020 年结束官方支持,USTC 镜像站已将其移至归档路径。以下是完整解决方案:
#### 步骤 1:修改镜像源配置
编辑 `/etc/apt/sources.list` 文件,替换为正确的归档路径:
```bash
# 主仓库
deb http://mirrors.ustc.edu.cn/debian-archive/debian/ jessie main contrib non-free
# 安全更新
deb http://mirrors.ustc.edu.cn/debian-archive/debian-security/ jessie/updates main contrib non-free
# 更新仓库
deb http://mirrors.ustc.edu.cn/debian-archive/debian/ jessie-updates main contrib non-free
```
#### 步骤 2:在 Dockerfile 中的修复方案
```dockerfile
FROM debian:jessie
# 修复镜像源
RUN sed -i 's|http://[^/]*/debian|http://mirrors.ustc.edu.cn/debian-archive/debian|g' /etc/apt/sources.list && \
sed -i 's|http://[^/]*/debian-security|http://mirrors.ustc.edu.cn/debian-archive/debian-security|g' /etc/apt/sources.list
# 安装软件(添加忽略签名验证参数)
RUN apt-get update -o Acquire::Check-Valid-Until=false && \
DEBIAN_FRONTEND=noninteractive apt-get install --allow-unauthenticated -y \
wget apache2 php5 gcc make \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
```
#### 关键修改说明:
1. **路径修正**:
- 主源:`http://mirrors.ustc.edu.cn/debian-archive/debian/`
- 安全源:`http://mirrors.ustc.edu.cn/debian-archive/debian-security/`
- USTC 将旧版系统归档在 `/debian-archive/` 路径下[^1]
2. **特殊参数**:
- `-o Acquire::Check-Valid-Until=false`:忽略仓库过期检查
- `--allow-unauthenticated`:允许安装未签名的包(归档仓库常见)
3. **替代镜像方案**(如 USTC 不可用):
```dockerfile
# 使用 163 镜像归档
RUN echo "deb http://mirrors.163.com/debian-archive/debian/ jessie main" > /etc/apt/sources.list && \
echo "deb http://mirrors.163.com/debian-archive/debian-security/ jessie/updates main" >> /etc/apt/sources.list
```
#### 验证方法:
```bash
docker build -t jessie-fixed . # 构建镜像
docker run -it jessie-fixed bash
apt-get update # 应显示成功更新
```
### 相关问题
1. 如何验证 Debian 归档镜像的路径结构是否正确?
2. 在 Docker 中调试 `apt-get update` 404 错误的最佳实践是什么?
3. 对于已结束支持的 Linux 发行版,有哪些可靠的软件源维护策略?
4. 如何为 ProFTPd 漏洞环境(CVE-2015-3306)配置特定版本的软件包?
5. 当容器构建失败时,如何通过 `docker exec` 进入中间状态进行调试?[^2]
Err:1 http://archive.raspberrypi.org/debian stretch InRelease Temporary failure resolving 'archive.raspberrypi.org' Err:2 http://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease Temporary failure resolving 'mirrors.ustc.edu.cn' Reading package lists... Done W: Failed to fetch http://mirrors.ustc.edu.cn/raspbian/raspbian/dists/stretch/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn' W: Failed to fetch http://archive.raspberrypi.org/debian/dists/stretch/InRelease Temporary failure resolving 'archive.raspberrypi.org' W: Some index files failed to download. They have been ignored, or old ones used instead.
根据你的问题,我猜测你遇到了在树莓派上安装软件时出现的问题。错误信息中提到了“Temporary failure resolving”,这意味着在连接软件源的过程中出现了网络连接问题。你可以尝试检查你的网络连接,或者更换其他可用的软件源。你可以在树莓派上执行以下命令更换为清华大学的软件源:
1.备份原有的源文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.编辑源文件
sudo nano /etc/apt/sources.list
3.在该文件中添加以下内容
#清华大学源
deb https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib
4.更新软件列表
sudo apt-get update
希望这能够帮助你解决问题。
阅读全文
相关推荐

















