【已解决】执行apt-get update报错404 Not Found的解决方案——docker 镜像下安装报错

这篇具有很好参考价值的文章主要介绍了【已解决】执行apt-get update报错404 Not Found的解决方案——docker 镜像下安装报错。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题描述

docker容器中安装vim报错
执行apt-get install vim后报错:

E: Unable to locate package vim

更新安装源也报错
docker容器中执行apt-get update后报错:

 #进入镜像命令
 #docker exec -it 镜像Id或镜像name /bin/bash
[root@tdengine ~]# docker exec -it xxxxx /bin/bash
 #更新安装源
root@b258a4f121b3:/# apt-get update
Ign http://security.debian.org jessie/updates InRelease
Ign http://deb.debian.org jessie InRelease
Ign http://security.debian.org jessie/updates Release.gpg
Ign http://deb.debian.org jessie-updates InRelease
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://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]
Ign http://deb.debian.org jessie-backports InRelease
Ign http://deb.debian.org jessie Release.gpg
Ign http://deb.debian.org jessie-updates Release.gpg
Ign http://deb.debian.org jessie-backports Release.gpg
Ign http://deb.debian.org jessie Release
Ign http://deb.debian.org jessie-updates Release
Ign http://deb.debian.org jessie-backports Release
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://deb.debian.org jessie-backports/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.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://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

原因分析:

这个错误表明你使用的操作系统版本,即 Debian 8 (jessie) 已经停止支持并已归档,因此官方软件源已经关闭。
所以更新操作系统包列表时就会遇到 404 错误。


解决方案:

如果要继续使用这个操作系统版本,你需要使用归档的 Debian 镜像源来更新包列表。
你可以在 /etc/apt/sources.list 文件中添加以下内容,指定归档源地址(直接执行一下命令即可)文章来源地址https://www.toymoban.com/news/detail-628410.html

#备份原文件
mv /etc/apt/sources.list /etc/apt/sources.list.bak
#添加源地址
echo "deb http://archive.debian.org/debian/ jessie main" >>/etc/apt/sources.list
echo "deb-src http://archive.debian.org/debian/ jessie main" >>/etc/apt/sources.list

重新安装

root@b258a4f121b3:/# apt-get update
root@b258a4f121b3:/# apt-get install -y vim

到了这里,关于【已解决】执行apt-get update报错404 Not Found的解决方案——docker 镜像下安装报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • sudo apt-get update 失败 的解决

    参考了:执行sudo apt-get update失败的解决方案 我的报错情况如下(借用了别人的,我之前使用的Ubuntu默认源,下面的报错使用的清华源)。 Ubuntu的默认源有时候也是有用的,因而不要删除,Ubuntu20.04默认源source.list文件内容:ubuntu20.04 LTS系统默认源source.list文件 我在Ubuntu 原 sour

    2024年02月09日
    浏览(32)
  • PVE使用apt-get update更新出现401的解决办法

    PVE安装完毕后,会自动添加一个企业存储库的订阅,但如果您是免费用户,在使用 apt-get update 更新软件的时候会出现401错误,错误内容如下: 解决办法 备份原有的存储库: 然后修改 /etc/apt/sources.list 在末尾添加免费的存储库: 最后再更新即可: apt-get update 此文部分内容参

    2024年02月13日
    浏览(53)
  • 【问题整理】Ubuntu 执行 apt-get install xxx 报错

    一、问题描述: 执行apt-get install fcitx时,报如下错误 二、解决方法: 尝试修复依赖问题: 这个命令会尝试修复系统中的依赖问题,这可能会解决安装过程中的错误。 清理残留文件: 这些命令将重新配置未完成的安装,并清理不再需要的文件。 重新配置 GRUB: 如果您正在安装

    2024年02月13日
    浏览(27)
  • 执行命令:sudo apt-get update时出错,仓库xx不再含有/没有Release文件,无法用该源更新【ubuntu21.04虚拟机】

    在新安装 ubuntu虚拟机 后,使用 sudo apt-get update 命令时出现 仓库xx不再含有/没有Release文件,404 Not Found [IP: x.x.x.x],无法用该源更新错误 ,如下图: 话不多说,直接上解决方案: https://mirrors.ustc.edu.cn/repogen/ 我的 ubuntu 是 21.04 版本,所以选择21.04,选择 Download 该命令是将该文

    2024年02月13日
    浏览(39)
  • 成功解决ubuntu-22.04的sudo apt-get update一直卡在【0% [Waiting for headers]】

    在下载安装包的时候一直卡在0% [Waiting for headers], 报错信息 如下: Get:1 file:/var/cudnn-local-repo-ubuntu1804-8.5.0.96 InRelease [1,575 B] Get:1 file:/var/cudnn-local-repo-ubuntu1804-8.5.0.96 InRelease [1,575 B] Get:2 file:/var/cudnn-local-repo-ubuntu1804-8.5.0.96 Packages [950 B] Get:3 https://dl.google.com/linux/chrome/deb stable In

    2024年02月14日
    浏览(34)
  • 深入理解Linux中的“sudo apt-get update“命令

    在Linux操作系统中,sudo apt-get update 是一个常用的命令,用于更新系统中可用软件包的信息。这个命令允许用户获取最新的软件包列表和更新信息,以确保系统上的软件保持最新状态。在本文中,我们将详细解释sudo apt-get update命令的用法和工作原理。 目录 1.什么是 \\\"sudo apt-g

    2024年02月05日
    浏览(36)
  • Ubuntu之apt-get--解决安装docker的报错:Package docker-ce is not available, but is referred to by another p

    原文网址:Ubuntu之apt-get--解决安装docker的报错:Package docker-ce is not available, but is referred to by another p_IT利刃出鞘的博客-CSDN博客 本文介绍用Ubuntu的apt-get命令安装docker时提示docker-ce不可用的解决方法。 Package docker-ce is not available, but is referred to by another package 此版本的源中没有d

    2024年02月02日
    浏览(50)
  • 【Docker】 docker中apt-get update过慢,这样配置瞬间提速!

    今天办公地点的网络出奇的差,看电影看小说打游戏完全没影响,只要更新就蜗速前进,只能从网上翻下,看看有没有网速快的下载源。 碰巧看到官网有写国内可用的源地址,不常用,记录下以便下次查看。 点击进入:https://www.debian.org/mirror/list 进去以后是各个国家可用的镜

    2024年02月05日
    浏览(33)
  • 解决Ubuntu软件更新命令:sudo apt-get update的“N: 无法安全地用该源进行更新,所以默认禁用该源”错误并安装gcc

    使用快捷键:Ctrl+Alt+T打开终端进入命令行 使用命令确认Ubuntu版本: 镜像源网址: https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/ 打开之后如图所示,因为没有找到完全对应的Ubuntu版本号,尝试选择了Ubuntu版本:22.10,亲测可行 因为初始的Ubuntu不自带vim工具,所以这里用vi进行编辑文件

    2024年01月19日
    浏览(33)
  • sudo apt-get update时遇到 无法安全地用该源进行更新,所以默认禁用该源

    重新安装ca-certificates 安装地址 http://ports.ubuntu.com/pool/main/c/ca-certificates/ 选最新更新的 我是ubuntu 18.04,其他版本对应选择 或者用命令行 将文件下载到本地后使用以下命令 至此问题解决

    2024年02月13日
    浏览(34)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包