在VM虚拟机搭建Ubuntu系统学习或者测试时,常常要使用apt安装测试,但是由于系统自带的下载源在国外服务器上,下载速度慢的无法忍受。所以我们需要切换为国内镜像源,能显著加快安装包下载速度。
步骤$ cd /etc/apt/ $ cp sources.list sources.list.bak ## 备份系统自带的source列表 ## 选择合适的镜像源,如阿里云的镜像 http://mirrors.aliyun.com/ubuntu $ sed -i 's/^\(deb\|deb-src\) \([^ ]*\) \(.*\)/\1 http:\/\/mirrors.aliyun.com\/ubuntu \3/' sources.list ## 更新apt $ apt-get update国内镜像源
名称 | 地址 |
---|---|
阿里镜像源 | http://mirrors.aliyun.com/ubuntu |
清华大学镜像源 | https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ |
网易镜像源 | https://mirrors.163.com/ubuntu/ |
东北大学镜像源 | http:///ubuntu/ |
至于哪个源比较快,看个人的网络吧,可以自行测试下。本人使用的是阿里镜像源。