保持清醒,不断思考。

Mike lucis


  • 首页
  • 归档
  • 分类
  • 标签
  • 关于
  • 联系
  •     

© 2023 Mike lucis

Theme Typography by Makito

Proudly published with Hexo

备案号: 湘ICP备2021005917号-1

友情链接: Lonely's Bolg

ღゝ◡╹)ノ♡

更换Ubuntu国内镜像源

发布于 2020-06-27 Linux  安装配置 系统 Ubuntu 

¶ 更换Ubuntu国内镜像源:

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

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

¶ 准备工作:

¶ 备份源文件:

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

¶ 若要恢复文件则:

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

¶ 编辑源文件:

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

1
nano /etc/apt/sources.list

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

¶ 添加源:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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’ 。

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

1
2
sudo apt-get update
sudo apt-get upgrade

¶ 附录:

Ubuntu历史版本:

版本号 代号 发行日期
20.04 LTS Focal Fossa 2020/4/23
18.04 LTS Bionic Beaver 2018/04/26
16.04 LTS Xenial Xerus 2016/04/21
14.04 LTS Trusty Tahr 2014/04/18

分享到 

 上一篇: 在WINDOWS环境下配置C语言编译环境 下一篇: 关于HTML中的 !DOCTYPE 声明 

© 2023 Mike lucis

Theme Typography by Makito

Proudly published with Hexo

备案号: 湘ICP备2021005917号-1

友情链接: Lonely's Bolg

ღゝ◡╹)ノ♡