1、首先备份Ubuntu源列表:sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2、打开更新源列表:sudo gedit /etc/apt/sources.list
3、修改源列表。
中国科技大学的源一般使用起来比较快,直接选择中科大的源。
删除source.list文件中的源,将下面的直接复制过去:
# USTC (University of Science and Technology of Thina)
# xenial is ubuntu 16.04 version
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
4、更新源。 sudo apt-get update
5、安装:
sudo apt-get install build-essential