gpt4 book ai didi

docker - 无法在Docker Ubuntu镜像中安装软件包

转载 作者:行者123 更新时间:2023-12-02 19:45:21 24 4
gpt4 key购买 nike

我在docker上安装了Ubuntu 14.04镜像。之后,当我尝试在ubuntu镜像中安装软件包时,我无法找到软件包错误:

apt-get install curl

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package curl

如何解决这个错误?

最佳答案

这是因为镜像中没有包缓存,因此需要运行:

apt-get update

在安装软件包之前,并且如果您的命令在Dockerfile中,则需要:
apt-get -y install curl

要禁止命令的标准输出,请使用 -qq。例如。
apt-get -qq -y install curl

关于docker - 无法在Docker Ubuntu镜像中安装软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63756071/

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