当我构建我的dockerfile时,它执行以下操作:
FROM debian:jessie
...
RUN echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" > /etc/apt/sources.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 \
&& apt-get update \
&& apt-get install ansible我得到:
The following packages have unmet dependencies:
ansible : Depends: python-jinja2 but it is not installable
Depends: python but it is not installable
Depends: python-yaml but it is not installable
Depends: python-paramiko but it is not installable
Depends: python-httplib2 but it is not installable
Depends: python-six but it is not installable
Depends: python-crypto (>= 2.6) but it is not installable
Depends: python-setuptools but it is not installable
Depends: sshpass but it is not installable
Depends: python-pkg-resources but it is not installable安装ansible的过程不应该已经安装了这些软件包吗?我有点不喜欢这个,但据我所知,一个软件包可以列出其他软件包的依赖项,那么为什么这些包不自动安装呢?debian不应该至少也带python吗?
我已经把它们放到了apt-get脚本中,它很有用,但它不应该是自动的吗?如果ppa中的一个新的ansible包需要更多的包怎么办?它会毁了我的文件
发布于 2017-05-22 08:24:04
与使用/etc/apt/sources.list重写>文件不同,您可以使用>>追加文本。
因此,它将类似于以下内容。
RUN echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" >> /etc/apt/sources.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 \
&& apt-get update \
&& apt-get install -y ansible发布于 2017-04-17 21:58:03
尝试将-f选项添加到apt-get install,该选项试图修复损坏的依赖关系。在运行apt-get update之前,您还可能希望运行apt-get clean来清除本地apt回购。这些都适用于我的封隔器构建,它使用了Ansible provisioner。
您的代码将变成:
RUN echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" > /etc/apt/sources.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 \
&& apt-get autoclean \
&& apt-get update \
&& apt-get install -f ansible关于更多的细节,我推荐这个极好的答案给更广泛的问题,“添加PPA后如何解决未满足的依赖关系?”
https://askubuntu.com/questions/889734
复制相似问题