Ubuntu 镜像源列表
名称 | URL |
---|---|
阿里云 | mirrors.aliyun.com |
清华 | mirrors.tuna.tsinghua.edu.cn |
中科大 | mirrors.ustc.edu.cn |
更换 Ubuntu 镜像源
更换 Ubuntu 镜像源只需替换 /etc/apt/sources.list
文件中的 archive.ubuntu.com
为对应的镜像源地址即可。
通过 vim 更换 Ubuntu 镜像源
1sudo vim /etc/apt/sources.list
然后输入以下命令以批量替换镜像源 URL,这里以阿里云(mirrors.aliyun.com
)为例。
1:%s/archive.ubuntu.com/mirrors.aliyun.com/g
然后 :w
保存即可。
通过 sed 更换 Ubuntu 镜像源
1sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.aliyun.com@g' /etc/apt/sources.list