因为ubuntu服务器在国外,当我们需要安装或者更新某些包的时候异常慢,这个时候我们就可以考虑换源,换成清华大学桥接的服务器。
ubuntu16换源
1、需要安装虚拟机工具,如果是VMware的话就是安装tool,virtualbox的话就是安装增强功能,具体方法可百度 安装完之后就可以在主机直接复制内容到虚拟机
2、使用vi打开配置文件 /etc/apt/sourecs.list
指令 sudo vi /etc/apt/sourecs.list
3、利用 dd 指令将源文件内容删除,然后将内容换成如下:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
更改完后保存退出
4、重启 然后就可以sudo apt-get update 了