网上都是通过修改/etc/apt/sources.list再update的方式改源的。可是docker ubuntu镜像没有vi编辑器,要先update才可以安装vim。
官方源的速度太慢了,等半天都没有update完。有没有方法快速修改/etc/apt/sources.list呢?其实是有的:
以下通过正则替换的方式改为阿里的镜像即可直接 update
sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
apt-get clean
apt-get update -y