更换Ubuntu国内镜像源

更换Ubuntu国内镜像源:

由于Ubuntu官方软件仓库服务器位于国外,导致我们国内访问体验非常糟糕,下载网速只有200-300k左右,令人泪目。

所以我们需要将系统默认下载地址配置为国内的镜像源,以此提高用户体验。

准备工作:

备份源文件:

cp /etc/apt/sources.list /etc/apt/sources.list.bak

若要恢复文件则:

cp /etc/apt/sources.list.bak /etc/apt/sources.list

编辑源文件:

使用nano编辑器对源文件进行编辑(需要root权限):

nano /etc/apt/sources.list

(使用 # 将原来默认源地址注释掉)

添加源:

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 

##测试版源  
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  

#源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
#测试版源  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  

#Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner  
deb http://extras.ubuntu.com/ubuntu/ xenial main

(此处使用阿里云的源为例,Ubuntu版本为16.04)

注意:Ubuntu系统根据其版本不同,其系统代号也不同,例如16.04版本其代号为Xenial Xerus,而20.04版本其代号为Focal Fossa,故镜像源参数也有所不同,若你想将上文中针对Ubuntu16.04版本的国内镜像源用于20.04版本,则你需要将代码中 ‘xenial’ 替换为 ‘Focal’ 。

执行更新命令(应用源):

 sudo apt-get update
 sudo apt-get upgrade 
附录:

Ubuntu历史版本:

版本号代号发行日期
20.04 LTSFocal Fossa2020/4/23
18.04 LTSBionic Beaver2018/04/26
16.04 LTSXenial Xerus2016/04/21
14.04 LTSTrusty Tahr2014/04/18
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值