docker容器中安装vim
2018-03-03 22:17
656 查看
在使用docker容器时,有时候里边没有安装vim,敲vim命令时提示说:vim: command not found,这个时候就需要安装vim,可是当你敲apt-get install vim命令时,提示:
这时候需要敲:apt-get update,这个命令的作用是:同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包。
等更新完毕以后再敲命令:apt-get install vim命令即可。
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 中列出的源的索引,这样才能获取到最新的软件包。
等更新完毕以后再敲命令:apt-get install vim命令即可。
配置国内镜像源
实际在使用过程中,运行 apt-get update,然后执行 apt-get install -y vim,下载地址由于是海外地址,下载速度异常慢而且可能中断更新流程,所以做下面配置:mv /etc/apt/sources.list /etc/apt/sources.list.bak echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list #更新安装源 apt-get update
相关文章推荐
- docker容器中安装vim,nginx等出现Unable to locate package
- docker容器 安装vim 安装nginx docker E: Unable to locate package nginx
- docker容器中安装vim 、telnet、ifconfig命令
- docker容器中安装vim 、telnet、ifconfig命令
- docker容器中安装vim
- docker容器 安装vim 安装nginx docker E: Unable to locate package nginx
- docker容器如何安装vim
- docker容器中安装vim
- docker容器中安装vim
- docker容器中安装vim 、telnet、ifconfig命令
- docker容器中安装vim
- docker容器中安装vim
- docker容器中安装vim
- docker容器中安装vim 、telnet、ifconfig命令
- ubuntu无法安装vim软件包
- vim 树形目录插件NERDTree安装及简单用法
- docker容器中安装vi命令
- vim 插件之 gist.vim 的安装
- vim中cscope工具安装与使用
- docker容器时,有时候里边没有安装vim,提示vi: command not found