小编给大家分享一下修改Ubuntu源列表的方法,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
Ubuntu缺省的配置的源并不是国内的服务器,下载更新软件都比较慢,本文介绍如何设置源列表,选择比较快的源以节省下载时间。
配置步骤
1. 备份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
2. 选择合适的源,替换原文件的内容,保存编辑好的文件
以阿里云更新服务器为例(从实际测试上结果分析,个人认为阿里云比网易和搜狐的服务器要快):
deb http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse
根据具体使用的Ubuntu的版本不同,将上述文本中XXXXX替换为下面对应版本的字符串:
Utopic(14.10): utopic
Trusty(14.04): trusty
Precise(12.04): precise
Lucid(10.04): lucid
3. 刷新列表
sudo apt-get update
更新完毕后,再次安装源时,将从新服务器上下载源包。
备注:
Ubuntu 16.04 TLS版本镜像源:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main 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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
以上是修改Ubuntu源列表的方法的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。