Docker:安装 apt-utils 时遇到问题

标签 docker apt

我正在尝试在 Docker 上安装 apt-utils,因为当我刚刚执行 apt-get update 时,我收到了错误:debconf: delaying包配置,因为 apt-utils 没有安装。所以我添加了一行来安装apt-utils(连同curl):

RUN apt-get update && apt-get install -y apt-utils && apt-get install -y curl

但是,我仍然收到那个错误,让我相信我的命令不起作用。以下是我尝试构建图像时的输出。

Step 5/12 : RUN apt-get update && apt-get install -y apt-utils && apt-get install -y curl
 ---> Running in 6e6565ff01bd
Get:1 http://security.debian.org jessie/updates InRelease [94.4 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:3 http://deb.debian.org jessie Release.gpg [2420 B]
Get:4 http://deb.debian.org jessie Release [148 kB]
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [624 kB]
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [23.0 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.1 MB in 6s (1541 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  libapt-inst1.5
The following NEW packages will be installed:
  apt-utils libapt-inst1.5
0 upgraded, 2 newly installed, 0 to remove and 24 not upgraded.
Need to get 537 kB of archives.
After this operation, 1333 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian/ jessie/main libapt-inst1.5 amd64 1.0.9.8.4 [169 kB]
Get:2 http://deb.debian.org/debian/ jessie/main apt-utils amd64 1.0.9.8.4 [368 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 537 kB in 0s (557 kB/s)
Selecting previously unselected package libapt-inst1.5:amd64.
(Reading database ... 21676 files and directories currently installed.)
Preparing to unpack .../libapt-inst1.5_1.0.9.8.4_amd64.deb ...
Unpacking libapt-inst1.5:amd64 (1.0.9.8.4) ...
Selecting previously unselected package apt-utils.
Preparing to unpack .../apt-utils_1.0.9.8.4_amd64.deb ...
Unpacking apt-utils (1.0.9.8.4) ...
Setting up libapt-inst1.5:amd64 (1.0.9.8.4) ...
Setting up apt-utils (1.0.9.8.4) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
Removing intermediate container 6e6565ff01bd
 ---> f65e29c6a6b9
Step 6/12 : RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
 ---> Running in f5764ba56103
Detected operating system as debian/8.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing debian-archive-keyring which is needed for installing
apt-transport-https on many Debian systems.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/github_git-lfs.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.
Removing intermediate container f5764ba56103
 ---> a4e64687ab73

这是什么原因造成的,我该如何解决?

最佳答案

这实际上不是一个错误,忽略它是安全的。我已经构建了大量的容器镜像,但没有在其中任何一个上安装过 apt-utils,并且无论此警告消息如何,所有软件包安装都通过并正常工作。

无论如何,如果你想拥有 apt-utils - 安装它。它会给你这个警告 once 然后它会在以后调用 apt-get 时消失(正如你在自己的日志中看到的那样,安装 curl 时没有该消息) .

注意,如果您安装了 apt-utils,您会收到其他警告(因为现在安装程序 可以 运行交互式配置,但会尝试这样做并失败)。要抑制这些并具有具有默认交互配置的软件包,请像这样运行 apt-get DEBIAN_FRONTEND=noninteractive apt-get install -y pkgs....

关于Docker:安装 apt-utils 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51023312/

相关文章:

reactjs - react : Module not found: Can't resolve 'react-html-parser'

linux - 如何通过 SSH 从 jenkins execute shell 进入正在运行的 docker 容器

docker - 将主机目录挂载到容器

Docker:仅限制与本地主机的传出连接,同时允许所有传入连接

postgresql - 如何在 ubuntu 14.04 中安装 postgis 1.5?

linux - apt-get 停止工作

mysql - 无法卸载 mysql-server-8.0

javascript - docker compose 将 mongodb 容器与 Node js 容器连接起来

python - ubuntu 上最新的 scipy 版本

Ubuntu安装以前版本的erlang解决方案包