1. apt-get install vim
提示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vim
Building dependency tree
Reading state information... Done
E: Unable to locate package vim
2. apt-get update
需要更换docker debian中apt-get源替换为阿里源和清华源
cp /etc/apt/sources.list /etc/apt/sources.list.bak ; # 先备份 echo " " > /etc/apt/sources.list ; # 清空文件 echo "deb http://mirrors.aliyun.com/debian jessie main" >> /etc/apt/sources.list ; echo "deb http://mirrors.aliyun.com/debian jessie-updates main" >> /etc/apt/sources.list ; echo "deb https://mirrors.ustc.edu.cn/debian jessie-updates main" >> /etc/apt/sources.list ;
可能会出的问题:The following signatures couldn't be verified because the public key is not available: NO_PUBKEY xxxxxxxx('公钥编码')
解决方法:将公钥添加至服务器,即终端中输入:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys '公钥编码'
添加成功后终端输出为
gpg: key '公钥编码': public key "xxxxxx" imported
gpg: Total number processed: 1
gpg: imported: 1
3. 等更新完毕以后再敲命令:apt-get install vim命令即可。