[英]How to install a package using apt-get in ubuntu container inside Docker
I have installed docker on windows 10. After that, pull the ubuntu
container. 我已经在Windows 10上安装了docker。之后,拉出
ubuntu
容器。 After running the container with this docker run -t -i --privileged ubuntu bash
or docker run -it ubuntu
command, I've get this root@7f72926f3608:/#
in console. 这种运行容器后
docker run -t -i --privileged ubuntu bash
或docker run -it ubuntu
命令,我已经得到这root@7f72926f3608:/#
控制台。
Then, try to install the python
package using apt-get
like $sudo apt-get install python
or apt-get install python
, but I've gotten the following error in console: 然后,尝试使用
apt-get
来安装python
包,例如$sudo apt-get install python
或apt-get install python
,但在控制台中出现以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python
Hence, the question is how can I install a package in ubuntu container inside docker? 因此, 问题是如何在docker内部的ubuntu容器中安装软件包?
运行apt-get update
,然后安装软件包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.