1 首先要进入容器内执行,保存目前源
mv /etc/apt/sources.list /etc/apt/sources.list.bak
2修改源,由于docker默认没有vim的包 所以无法使用vim指令,所以我们要换源
cat <<EOF >/etc/apt/sources.list deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free EOF
3执行更新源
apt update apt-get install vim
4恢复源
mv /etc/apt/sources.list.bak /etc/apt/sources.list
标签:sources,解决方案,list,apt,vim,etc,docker From: https://www.cnblogs.com/pushuiyu/p/17107545.html