Ubuntu apt install Failed to fetch http://security.ubuntu.com/......404 Not Found [IP: 91.xx.xx.xx]

Window 11使用WLS2 搞了个Ubuntu ,安装PHP时报错,如图
在这里插入图片描述
关键字:
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-common_7.4.3-4ubuntu2.18_amd64.deb 404 Not Found [IP: 91.189.91.82 80]

有解决办法说,修改软件源或配置DNS,这些我都没有尝试过

根据提示,执行了 sudo apt-get update 执行完成之后,

再次安装想安装的软件 ,就成功了。

The following extra packages will be installed: openssh-client openssh-server ssh-import-id Suggested packages: libpam-ssh keychain monkeysphere openssh-blacklist openssh-blacklist-extra rssh molly-guard The following NEW packages will be installed: openssh-server ssh ssh-import-id The following packages will be upgraded: openssh-client 1 upgraded, 3 newly installed, 0 to remove and 767 not upgraded. Need to get 1,310 kB of archives. After this operation, 926 kB of additional disk space will be used. Do you want to continue [Y/n]? y WARNING: The following packages cannot be authenticated! openssh-client openssh-server ssh ssh-import-id Install these packages without verification [y/N]? y Err http://us.archive.ubuntu.com/ubuntu/ precise-updates/main openssh-client i386 1:5.9p1-5ubuntu1.10 404 Not Found [IP: 91.189.91.82 80] Err http://us.archive.ubuntu.com/ubuntu/ precise/main ssh-import-id all 2.10-0ubuntu1 404 Not Found [IP: 91.189.91.82 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main openssh-client i386 1:5.9p1-5ubuntu1.10 404 Not Found [IP: 91.189.91.81 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main openssh-server i386 1:5.9p1-5ubuntu1.10 404 Not Found [IP: 91.189.91.81 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main ssh all 1:5.9p1-5ubuntu1.10 404 Not Found [IP: 91.189.91.81 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-client_5.9p1-5ubuntu1.10_i386.deb 404 Not Found [IP: 91.189.91.81 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-server_5.9p1-5ubuntu1.10_i386.deb 404 Not Found [IP: 91.189.91.81 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssh/ssh_5.9p1-5ubuntu1.10_all.deb 404 Not Found [IP: 91.189.91.81 80] Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/s/ssh-import-id/ssh-import-id_2.10-0ubuntu1_all.deb 404 Not Found [IP: 91.189.91.82 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
最新发布
08-09
<think>嗯,用户遇到了Ubuntu系统中使用apt-get更新时出现404 Not Found错误的问题,想要解决方法。我需要先回想一下常见的导致这个错误的原因以及相应的解决办法。首先,根据之前看到的引用内容,比如引用[3]提到可能是因为软件源配置中包含了不支持的架构,比如arm64,而系统本身是amd64的,这会导致无法找到对应的软件包,从而出现404错误。解决方法可能是移除不需要的架构,比如使用sudo dpkg --remove-architecture arm64命令。 另外,引用[1]中的例子显示,用户可能在更新或安装特定软件包时遇到404错误,解决办法是运行apt update后再次尝试安装。这可能涉及到软件源列表过时或者暂时不可用的情况,所以更新软件源列表可能有效。 接下来,我需要整理解决步骤。首先应该建议用户检查软件源配置是否正确,可能存在的拼写错误或者不可用的仓库地址。然后,执行sudo apt update来更新软件列表,并观察错误信息中的具体URL,确认是否源地址正确。如果错误信息中提到的架构问题,比如arm64,那么按照引用[3]的方法移除该架构。 此外,如果问题仍然存在,可能需要更换镜像源,比如换成阿里云或者清华大学的源,确保仓库地址有效且支持当前系统版本。清理旧的软件包缓存也可能有帮助,使用sudo apt clean命令。 最后,检查网络连接是否正常,排除网络问题导致的无法访问仓库服务器的情况。如果用户使用的是公司或学校的网络,可能需要代理设置。 总结下来,解决步骤应该是:检查软件源配置,更新软件列表,移除不需要的架构,更换镜像源,清理缓存,检查网络。然后生成相关问题,帮助用户深入了解可能的相关问题,比如如何更换镜像源,如何诊断软件源错误等。</think>### 解决Ubuntu中`apt-get`出现404错误的步骤 1. **检查软件源配置** 首先确认`/etc/apt/sources.list`和`/etc/apt/sources.list.d/`下的文件是否有拼写错误或无效的仓库地址。例如,过时的Ubuntu版本(如16.04)的源可能不再维护,需更新为支持的版本[^3]。 2. **更新软件列表并修复架构冲突** 运行以下命令刷新软件源: ```bash sudo apt update ``` 若报错涉及`arm64`等无关架构(如`binary-arm64/Packages 404 Not Found`),需移除冲突架构: ```bash sudo dpkg --remove-architecture arm64 # 移除arm64架构支持 ``` 3. **更换镜像源** 若错误由镜像源失效引起,替换为国内镜像源(如阿里云、清华大学源): ```bash sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list sudo apt update ``` 4. **清理缓存并重试** 清除残留的无效软件包缓存: ```bash sudo apt clean sudo apt autoclean sudo rm -rf /var/lib/apt/lists/* sudo apt update ``` 5. **验证网络连接与代理设置** 确保网络畅通,若使用代理需配置`apt`代理: ```bash echo 'Acquire::http::Proxy "http://<代理地址>:<端口>";' | sudo tee /etc/apt/apt.conf.d/proxy.conf ``` ### 示例操作 若报错信息包含`openjdk-11-jre-headless_11.0.16+8-0ubuntu1~18.04_amd64.deb`,可尝试: ```bash sudo apt install java-common default-jre default-jdk # 安装通用依赖[^1] ```
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值