docker容器中安装vi命令

问题

vim: command not found

解决:

apt-get update

apt-get install vim

换国内源:

echo "deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free \n\
deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free \n\
deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free \n\
deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free \n\
deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free \n\
deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free \n\
deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free  \n\
" > /etc/apt/sources.list

可能错误:

Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

解决错误:

rm /var/lib/apt/lists/lock

 

posted @ 2021-07-05 16:50  pergrand  阅读(226)  评论(0编辑  收藏  举报