在使用docker容器时,有时候里边没有安装vim,敲vim命令时提示说:vim: command not found,这个时候就须要安装vim,但是当你敲apt-get install vim命令时,提示:docker
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package vim
这时候须要敲:apt-get update,这个命令的做用是:同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包。vim
等更新完毕之后再敲命令:apt-get install vim命令便可。ui