E: Unable to locate package vim 问题解决

一、问题分析

在docker容器内使用VIM命令时,因为没有安装vim;所以提示安装;但是在安装过程中却抛出一下问题:

root@1367fd5813a1:/# apt-get install vim 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package 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

apt-get install -y vim

注:以上内容仅提供参考和交流,请勿用于商业用途,如有侵权联系本人删除!

你可能感兴趣的:(运维,#,问题记录,docker,vim)