设置ubantu的软件源地址
查看所用的源
- $ sudo vim /etc/apt/sources.list
由于安装的Ubuntu Server 16.04.1 LTS是英文版的,软件源就默认都是 us.archive.ubuntu.com(英国) 的,所以很慢。
- # deb cdrom:[Ubuntu-Server 16.04.1 LTS _Xenial Xerus_ - Release amd64 (20160719)]/ xenial main restricted
- #deb cdrom:[Ubuntu-Server 16.04.1 LTS _Xenial Xerus_ - Release amd64 (20160719)]/ xenial main restricted
- # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
- # newer versions of the distribution.
- deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
- # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
- ## Major bug fix updates produced after the final release of the
- ## distribution.
- deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
- # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
- ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
- ## team. Also, please note that software in universe WILL NOT receive any
- ## review or updates from the Ubuntu security team.
- deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
- # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
- deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
- # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
- ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
- ## team, and may not be under a free licence. Please satisfy yourself as to
- ## your rights to use the software. Also, please note that software in
- ## multiverse WILL NOT receive any review or updates from the Ubuntu
- ## security team.
- deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
- # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
- deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
- # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
- ## N.B. software from this repository may not have been tested as
- ## extensively as that contained in the main release, although it includes
- ## newer versions of some applications which may provide useful features.
- ## Also, please note that software in backports WILL NOT receive any review
- ## or updates from the Ubuntu security team.
- deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
- # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
- ## Uncomment the following two lines to add software from Canonical's
- ## 'partner' repository.
- ## This software is not part of Ubuntu, but is offered by Canonical and the
- ## respective vendors as a service to Ubuntu users.
- # deb http://archive.canonical.com/ubuntu xenial partner
- # deb-src http://archive.canonical.com/ubuntu xenial partner
- deb http://security.ubuntu.com/ubuntu xenial-security main restricted
- # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
- deb http://security.ubuntu.com/ubuntu xenial-security universe
- # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
- deb http://security.ubuntu.com/ubuntu xenial-security multiverse
- # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
为了提高下载速度,将源改为国内的 cn.archive.ubuntu.com ,现在 cn.archive.ubuntu.com 指向阿里云的开源镜像站 mirrors.aliyun.com,下载速度很快。
1. 重命名原来的源作为备份:
- $ sudo mv /etc/apt/sources.list sources.list_backup
2. 新建一个sources.list文件
- $ sudo vim /etc/apt/sources.list
输入如下内容并保存退出:
- deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
- deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
- deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe
- deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
- deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
- deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
- deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
- deb http://security.ubuntu.com/ubuntu xenial-security main restricted
- deb http://security.ubuntu.com/ubuntu xenial-security universe
- deb http://security.ubuntu.com/ubuntu xenial-security multiverse
3. 更新apt软件源:
- $ sudo apt-get update
结束,以后更新下载软件就快多了。
摘自http://blog.csdn.net/a787202867/article/details/53084602
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】