Ubuntu 配置镜像源

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 # 恢复
posted @ 2019-08-15 15:48  程序媛李李李李蕾  阅读(3709)  评论(0编辑  收藏  举报