ubuntu - 无法在 Docker 容器中安装 ntopng(rfkill 问题)

标签 ubuntu docker ubuntu-16.04

这是我得到的错误:

/var/lib/dpkg/info/rfkill.postinst: 5: /var/lib/dpkg/info/rfkill.postinst: udevadm: not found
dpkg: error processing package rfkill (--configure):
 subprocess installed post-installation script returned error exit status 127

和:
Setting up python3 (3.5.1-3) ...
Setting up lsb-release (9.20160110ubuntu0.2) ...
Setting up dh-python (2.20151103ubuntu1.1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for ca-certificates (20160104ubuntu1) ...
Updating certificates in /etc/ssl/certs...
173 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Errors were encountered while processing:
 rfkill
E: Sub-process /usr/bin/dpkg returned an error code (1)

这是我的 Dockerfile:
FROM ubuntu:xenial
MAINTAINER Jean-Nicolas Boulay <jn@yaloub.com>

# Source: http://packages.ntop.org/apt/

RUN export DEBIAN_FRONTEND=noninteractive \
    && export COMPOSER_ALLOW_SUPERUSER=1 \
    && export LC_ALL=C \
    && export LC_ALL="en_US.UTF-8" \
    && export LC_CTYPE="en_US.UTF-8" \
    && export LANGUAGE="en_US:en" \
    && export LANG=C \
    && dpkg --configure -a \
    && apt-get update -qq -y \
    && apt-get install --no-install-recommends --no-install-suggests -y -q \
        apt-utils \
        lsb-release \
        ca-certificates \
        curl \
        wget \
        rfkill \
    && wget http://apt.ntop.org/16.04/all/apt-ntop.deb \
    && dpkg -i apt-ntop.deb \
    && rm -rf apt-ntop.deb \
    && apt-get clean all \
    && apt-get update -qq -y \
    && apt-get upgrade -y \
    && apt-get install --no-install-recommends --no-install-suggests -y -q \
        pfring \
        nprobe \
        ntopng \
        ntopng-data \
        n2disk \
        cento \
        pfring-drivers-zc-dkms \
        nbox \
        redis-server \
        libpcap0.8 \
        libmysqlclient20 \
        python \
        python-pip \
    && python -m pip install --upgrade pip \
    && pip install setuptools \
    && pip install supervisor \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /tmp/* \
    && rm -rf /var/tmp/*

COPY redis.conf /etc/redis/redis.conf
COPY conf/supervisord/supervisord.conf /etc/supervisord.conf

EXPOSE 3000

CMD ["/usr/bin/supervisord"]

那么如何用 rfkill 解决这个问题呢?

最佳答案

它似乎在尝试运行 udevadm作为其安装后的一部分。

来自 searching ubuntu packages似乎 udev包提供了这个。

只要安装udev 应该可以安装rfkill预先。

我能够得到这个 dockerfile 来构建:

FROM ubuntu:xenial

RUN apt-get update && \
    # Without this line, it did not build properly
    apt-get install -y --no-install-recommends udev && \
    apt-get install -y --no-install-recommends \
        rfkill && \
    apt-get clean

关于ubuntu - 无法在 Docker 容器中安装 ntopng(rfkill 问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45383204/

相关文章:

node.js - 无法从终端 ubuntu 18.04 LTS 正确安装 Mongodb

docker - 为什么我不能在 Docker 容器中以非 root 身份运行 IPU 程序?

linux - 当 Ubuntu 从 14.04 lts 升级到 16.04 lts 时,是否可以在 Ubuntu 中创建交换空间?

linux - 使用标准 linux 命令的段错误

linux - 在 bash 中使用/home/directory 从所有用户创建菜单

linux - Ubuntu错误?仅在以 root 身份登录后的环境变量

csv - 无法在 : file:/var/lib/neo4j/import with Neo4j docker image 加载外部资源

docker - Rails 6.1.0 [webpack-cli] TypeError : Cannot read property 'plugins' of undefined

mysql - 如何在 Ubuntu 16.04 中将 mysql 数据库导入到我选择的驱动器中?

node.js - 如何在Ubuntu 16.04上使用node.js本地连接到postgresql?