gpt4 book ai didi

python - Docker 与 ubuntu :trusty and installing python-dev

转载 作者:行者123 更新时间:2023-12-01 01:39:43 28 4
gpt4 key购买 nike

感谢您查看此内容。我使用https://github.com/kartoza/docker-ssh为ssh创建了一个docker镜像

唯一的区别是我使用了 ubuntu:trusty。

此后,我启动了容器并通过 ssh 连接到容器,然后尝试安装 python,得到以下结果:

root@a20f46f358b3:/script/docker/ubuntu-trusty# sudo apt-get -qq -y --no- 
install-recommends install python-dev
E: Unable to correct problems, you have held broken packages.
root@a20f46f358b3:/peloton/peloton/script/docker/ubuntu-trusty# sudo apt-get
install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python-dev : Depends: libpython-dev (= 2.7.5-5ubuntu3) but it is not going
to be installed
Depends: python2.7-dev (>= 2.7.5-1~) but it is not going to be
installed
E: Unable to correct problems, you have held broken packages.

我应该使用不同的图像来创建容器吗?

没有持有的包,我通过执行验证并且没有输出。

dpkg --get-selections | grep hold

有什么想法可以解决这个问题吗?非常感谢您的指导。

问候,〜 Ember

最佳答案

在 Dockerfile 中尝试

RUN apt-get update && sudo apt-get upgrade

并检查dependecies

apt-get install -f python2.7-dev

关于python - Docker 与 ubuntu :trusty and installing python-dev,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52012559/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com