AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 961899
Accepted
Juan Leni
Juan Leni
Asked: 2017-10-05 01:33:13 +0800 CST2017-10-05 01:33:13 +0800 CST 2017-10-05 01:33:13 +0800 CST

安装包时找不到404

  • 772

我有一个脚本一直运行良好,直到现在我突然收到以下消息:

Get:81 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-software-properties all 0.96.20.7 [20.7 kB]
Get:82 http://archive.ubuntu.com/ubuntu xenial/main amd64 python3-pycurl amd64 7.43.0-1ubuntu1 [42.3 kB]
Get:83 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3-software-properties all 0.96.20.7 [20.3 kB]
Get:84 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 software-properties-common all 0.96.20.7 [9452 B]
Get:85 http://archive.ubuntu.com/ubuntu xenial/main amd64 xz-utils amd64 5.1.1alpha+20120614-2ubuntu2 [78.8 kB]
Err:86 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 unattended-upgrades all 0.90ubuntu0.7
  404  Not Found [IP: 91.189.88.161 80]
Fetched 23.7 MB in 1s (14.8 MB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python3.5/libpython3.5-minimal_3.5.2-2ubuntu0~16.04.2_amd64.deb  404  Not Found [IP: 91.189.88.161 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python3.5/python3.5-minimal_3.5.2-2ubuntu0~16.04.2_amd64.deb  404  Not Found [IP: 91.189.88.161 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python3.5/libpython3.5-stdlib_3.5.2-2ubuntu0~16.04.2_amd64.deb  404  Not Found [IP: 91.189.88.161 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python3.5/python3.5_3.5.2-2ubuntu0~16.04.2_amd64.deb  404  Not Found [IP: 91.189.88.161 80]

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libi/libidn/libidn11_1.32-3ubuntu1.1_amd64.deb  404  Not Found [IP: 91.189.88.161 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/u/unattended-upgrades/unattended-upgrades_0.90ubuntu0.7_all.deb  404  Not Found [IP: 91.189.88.161 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get -y install software-properties-common python-software-properties' returned a non-zero code: 100

运行时似乎:

apt-get -y install software-properties-common python-software-properties

某些服务器已关闭。我怎样才能避免这种依赖?这是持续集成服务器的一部分,我希望将来避免这些问题。

注意:我sudo apt update之前跑过。这实际上是 Dockerfile 的一部分:

FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install software-properties-common python-software-properties
RUN apt-get -y install ca-certificates curl
RUN apt-get -y install build-essential git sudo

构建容器在第二行失败。

16.04
  • 3 3 个回答
  • 16814 Views

3 个回答

  • Voted
  1. Best Answer
    Juan Leni
    2017-10-05T01:52:36+08:002017-10-05T01:52:36+08:00

    根据docker best practice,我应该将更新和安装放在同一 RUN 行。这样缓存将被正确更新。

    在这些更改之后,一切正常。

    • 9
  2. sean_j_roberts
    2018-05-07T06:13:05+08:002018-05-07T06:13:05+08:00

    如果您在使用 Docker 时遇到此问题,您可能需要运行 docker build 命令并--no-cache选择让它从头开始重新启动。

    • 3
  3. marko
    2017-10-05T02:11:04+08:002017-10-05T02:11:04+08:00

    由于某种原因,这些文件已从服务器中删除。

    打开一个新的浏览器窗口并在 URL 地址栏中复制/粘贴以下内容,然后按 Enter 并亲自查看:

    http://archive.ubuntu.com/ubuntu/pool/main/u/unattended-upgrades/unattended-upgrades_0.90ubuntu0.7_all.deb
    
    http://security.ubuntu.com/ubuntu/pool/main/libi/libidn/libidn11_1.32-3ubuntu1.1_amd64.deb
    

    你也可以试试:

    wget http://archive.ubuntu.com/ubuntu/pool/main/u/unattended-upgrades/unattended-upgrades_0.90ubuntu0.7_all.deb
    
    wget http://security.ubuntu.com/ubuntu/pool/main/libi/libidn/libidn11_1.32-3ubuntu1.1_amd64.deb
    

    你会得到同样的错误。

    请问可以发一下内容/etc/apt/sources.list吗?

    cat /etc/apt/sources.list
    

    您只需编辑文件中的 URL 以将 APT 重定向到不同的服务器并运行并重sudo apt update试。

    看看当我从我的一端访问其中一个 URL 时会发生什么:

    在此处输入图像描述

    这就是它失败的原因。您需要更改服务器引用。

    • 1

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve