Ubuntu 快速更换阿里源

简介: 本文主要给大家讲解如何为Ubuntu更换阿里源,通过以下四个步骤即可快速实现换源。

70.jpeg
镜像下载、域名解析、时间同步请点击 阿里巴巴开源镜像站

一、查看ubuntu的Codename

lsb_release -a | grep Codename | awk '{print $2}' # 输出结果为下文中的Codename

1.png

二、备份系统源

cd /etc/apt
sudo mv sources.list sources.list.bak

三、写入阿里云的源

vi sources.list

下面源信息中$Codename为第一步中系统的Codename,用记事本批量替换即可。

deb http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe

四、执行更新

执行以下命令,完成更新。

apt-get update

说明:可以通过http://mirrors.aliyun.com/ubuntu/dists/查看是否支持当前系统的Codename。

阿里巴巴开源镜像站 提供全面,高效和稳定的系统镜像、应用软件下载、域名解析和时间同步服务。”

相关文章
|
4月前
|
Ubuntu
ubuntu 22.04 阿里源
ubuntu 22.04 阿里源
1523 0
|
6月前
|
Ubuntu
ubuntu 换源 阿里源
ubuntu 换源 阿里源
633 0
|
9月前
|
Ubuntu
Ubuntu系统镜像下载,国内镜像站大全(山大/清华/阿里/浙大/中科大...)
装Ubuntu,是很多理工科同学入门的第一个挑战,首先我们就需要找到一个能用的iso镜像,根据你的网络环境的不同,不同的站点下载速度会不一样,下面列举一下几个比较好用的,都是来自Ubuntu官方推荐镜像站链接导航国内分区
2519 0
|
25天前
|
Ubuntu
ubuntu更换国内镜像源,下载增速
ubuntu更换国内镜像源,下载增速
|
6月前
|
Ubuntu PHP 开发工具
ubuntu 使用命令行更换国内源
ubuntu 使用命令行更换国内源
544 35
|
9月前
|
Ubuntu Linux
【Ubuntu系统更换清华大学镜像源【详解】】
Ubuntu是一种基于Debian的Linux操作系统,它的软件仓库中包含了许多开源软件包。由于全球用户的数量众多,因此Ubuntu的官方镜像源可能会受到访问压力的影响而变得较慢。为了避免这种情况,我们可以将Ubuntu系统的镜像源切换到清华大学镜像源。本文将详细介绍如何在Ubuntu系统中更换清华大学镜像源。
1055 0
|
9月前
|
Ubuntu C语言
Ubuntu 换阿里源
先说问题,今天在配置Ubuntu按照网上找的换源办法换源之后安装gcc之后无法安装G++。
1076 0
|
10月前
|
Ubuntu 索引
ubuntu更换apt源后依然搜索旧软件源下载失败问题
ubuntu更换apt源后依然搜索旧软件源下载失败问题
450 0
|
10月前
|
Ubuntu C语言
Ubuntu下更换gcc版本
Ubuntu下更换gcc版本
387 0
|
10月前
|
Ubuntu
ubuntu16.0更改国内阿里源,速度起飞,亲测可用
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup #备份当前也就是默认官方的源列表
1541 0