解决docker容器中没有vim命令

我也有梦想呀 / 2024-11-09 / 原文

问题现象

# 输入vim xxx文件 后控制台提示
bash: vim: command not found

解决办法

# 安装vim
apt-get install -y vim

如果提示下面信息:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package vim
更新apt-get
apt-get update

再执行

apt-get install -y vim