在VM虚拟机搭建Ubuntu系统学习或者测试时,经常要使用apt
安装测试,可是因为系统自带的下载源在国外服务器上,下载速度慢的没法忍受。因此咱们须要切换为国内镜像源,能显著加快安装包下载速度。ubuntu
$ 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://mirror.neu.edu.cn/ubuntu/ |
至于哪一个源比较快,看我的的网络吧,能够自行测试下。本人使用的是阿里镜像源。bash