ubuntu19.04更改国内镜像源

本文详细介绍了如何在Ubuntu19.04中更换为阿里云国内镜像源,包括备份原镜像源文件、修改sources.list文件的具体步骤,以及如何根据系统版本调整镜像源中的系统代号。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ubuntu19.04更改国内镜像源

最近搞了个19.04版本的ubuntu玩玩,如何配置相应版本的国内镜像源?
原镜像源文件存放在目录/etc/apt/sources.list下,我们拷贝一份sources.list文件,以便备用。

$ sudo cp -v /etc/apt/sources.list /etc/apt/sources.list.backup

然后将以下内容拷贝到sources.list

deb http://mirrors.aliyun.com/ubuntu/ disco main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ disco main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ disco-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ disco-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ disco-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ disco-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ disco-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ disco-backports main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ disco-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ disco-proposed main restricted universe multiverse

这个镜像源是阿里的,但注意这个地方

在这里插入图片描述
有个disco,这是个系统代号,不同的系统代号是不同的,disco是ubuntu19.04版本的代号,比如ubuntu18.04的系统代号是bionic
可以通过命令lsb_release -c查看系统代号
在这里插入图片描述
如果你找到的是其他版本使用的镜像源,那可以试着把其中的系统代号换成当前系统的代号即可。亲测18.04版本换19.04版本成功_~
更改好后更新即可:

$ sudo apt-get update

#ubuntu/ubuntu19.04更改国内镜像源#

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值