Ubantu设置国内镜像(阿里云、华为云)

1. 确定系统版本

国内有很多 Ubuntu 的镜像源,包括阿里的、网易的,还有很多教育网的源,比如:清华源、中科大源等。

不同的 ubantu 版本对应的镜像源有所不同,所以需要先查看系统的版本号:

bash 复制代码
lsb_release -a

// output
root@DESKTOP-Q58L5PB:/etc/apt# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal

可以看到系统的版本号是 20.04.6 LTS,注意这个开发代号 Codename = focal,Ubuntu每一个版本都有一个代号,这个一定要跟国内源对应,否则会出问题。


2. 镜像

2.1 阿里云镜像

通过以下地址可以看到阿里云 Ubuntu 各个版本的镜像地址,从中选择自己的系统版本就好,一定要选择 Codename 对应的版本。镜像地址: ubuntu镜像_ubuntu下载地址_ubuntu安装教程-阿里巴巴开源镜像站

以下是20.04.6 LTS 对应 forcal 的镜像源信息。

bash 复制代码
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  1. 备份官方镜像
bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
  1. 编辑 sources.list
bash 复制代码
vim /etc/apt/sources.list
  1. 更新镜像源
bash 复制代码
sudo apt update
sudo apt upgrade

2.2 其他

ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

ubuntu | 镜像站使用帮助 | 华为软件镜像站


Reference

  1. https://blog.csdn.net/MacWx/article/details/137689898
  2. https://blog.csdn.net/shenzhenyancheng/article/details/126786768
相关推荐
..过云雨17 小时前
11.【Linux系统编程】文件系统详解——从磁盘硬件到文件系统
linux·c++·后端·缓存
普中科技17 小时前
【普中Hi3861开发攻略--基于鸿蒙OS】-- 第 31 章 WIFI 实验-华为 IoTDA 设备接入
单片机·嵌入式硬件·华为云·鸿蒙·liteos·hi3861·普中科技
qq_2715817917 小时前
Ubuntu OpenCV C++ 获取MYNT EYE S1030-IR摄像头图像
linux·opencv·ubuntu
1560820721917 小时前
在Ubuntu20.04下安装iperf3
linux·ubuntu
G311354227318 小时前
云服务器系统 选择Windows和Linux的理由
linux·服务器·windows
BS_Li18 小时前
【Linux系统编程】调试器-gdb/cgdb
linux·调试器·gdb/cgdb
luoganttcc18 小时前
介绍一下 multiprocessing 的 Manager模块
linux·运维·服务器
阿巴~阿巴~18 小时前
线程互斥:并发编程中的互斥量(Mutex)与RAII风格锁管理机制
linux·线程·pthread·互斥量·线程互斥·线程封装·raii原则
可乐大数据18 小时前
macOS 一键免密登录阿里云 ECS:SSH 密钥对认证完整指南
macos·阿里云·ssh
牛奶咖啡1319 小时前
Linux中安装部署Hadoop集群的保姆级安装配置教程
linux·hadoop·openjdk21安装配置·openjre21安装配置·hadoop集群安装配置·linux的ssh配置·linux实现免密登录配置