我在Windows 10上安装了docker。然后,拉出ubuntu
容器。使用此docker run -t -i --privileged ubuntu bash
或docker run -it ubuntu
命令运行容器后,我在控制台中获得此root@7f72926f3608:/#
。
然后,尝试使用python
或apt-get
$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
因此,问题是如何在docker中的ubuntu容器中安装包?
答案 0 :(得分:9)
运行apt-get update
然后安装软件包。