docker容器中安装vi

时间:2022-03-08 17:18:52

容器中输入vi提示

root@e36f8029c9f2:/# vi
bash: vi: command not found

解决办法:

1.通过命令获取最新的软件包

  apt-get update

  apt-get upgrade

2.安装vi

  apt-get install vi

如果还提示:

root@e36f8029c9f2:/# apt-get install vi
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vi

解决办法:

1》更换软件源

2》安装vim,apt-get vim