Ubuntu换源(含西电校内源) 以及 系统修复源列表文件

2019-07-14 03:29发布

1.备份源的list文档,建议拷贝到自己的文件夹,或者记住路径sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
2.更换国内源sudo gedit /etc/apt/sources.list
把下列任一系列的源列表拷贝到文件底部,你也可以选择删除原始源西电源(校内网可用)deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial main restricted universe multiverse deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-security main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-security main restricted universe multiverse deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-updates main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-updates main restricted universe multiverse #deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-backports main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-backports main restricted universe multiverse #deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-proposed main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-proposed main restricted universe multiverse清华源deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src 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-src 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-src 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 # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse网易源deb http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse阿里源deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
3.更新源sudo apt-get update

4.一个小坑如果删除了原始源或者更改源list文件之后,执行sudo apt-get update报错,可以双击执行sources.list文件,进入ubuntu软件更新器,关闭时候点击跳出来的 重新载入 按钮,系统可以修复sudo apt-get update的使用,猜测可能是文件细微格式的原因或者是权限原因。

参考资料:https://blog.csdn.net/qq_35451572/article/details/79516563