zl程序教程

您现在的位置是:首页 >  工具

当前栏目

Docker解决没有vi、vim等命令

VimDocker命令 解决 没有 vi
2023-09-11 14:16:33 时间

1.同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,获取到最新的软件包。 

root@e96879cea783:/var/www/html/ctc/app/Services/Logic# apt update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://security.debian.org/debian-security buster/updates/main amd64 Packages [305 kB]

2.安装 vi 发现不好用接着来

root@e96879cea783:/var/www/html/ctc/app/Services/Logic# apt install vi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package vi

3、等更新完,再输入apt-get install vim,就会安装vim命令了。这样就可以使用vim命令了。

root@e96879cea783:/var/www/html/ctc/app/Services/Logic/Account# vi Register.php 
bash: vi: command not found
root@e96879cea783:/var/www/html/ctc/app/Services/Logic/Account# apt-get install vim
Reading package lists... Done
Building dependency tree