Ubuntu 配置镜像源
注, 如果添加镜像后没有自己要安装的软件, 切回原镜像即可, 只是有点慢.
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo ''>/etc/apt/sources.list
echo deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse>>/etc/apt/sources.list
echo deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse>>/etc/apt/sources.list
echo deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse>>/etc/apt/sources.list
echo deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse>>/etc/apt/sources.list
apt-get update
# cp /etc/apt/sources.list.bak /etc/apt/sources.list # 恢复