【Ubuntu】修改Ubuntu的apt-get源为国内镜像源的方法

原文地址:https://blog.csdn.net/qq_31456593/article/details/89638163

1doit@doit-System-Product-Name:~$ cd /etc/apt/ 2# 备份源 3doit@doit-System-Product-Name:/etc/apt$ sudo cp sources.list sources.list.bk 4# 把原换为清华源 5doit@doit-System-Product-Name:/etc/apt$ sudo gedit sources.list 6 7 8

修改sources.list的内容为下面的设置

1# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 2deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse 3# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse 4deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse 5# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse 6deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse 7# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse 8deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse 9# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse 10 11# 预发布软件源,不建议启用 12# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse 13# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse 14 15

更新apt-get

1doit@doit-System-Product-Name:/etc/apt$ sudo apt-get update 2 3

代码交流 2021