Ubuntu 22.04系统国内镜像源配置指南

备份原配置文件

在修改前需备份原文件,防止配置错误导致系统异常:

bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

编辑源文件

使用文本编辑器(如vinano)修改源文件:

bash 复制代码
sudo vi /etc/apt/sources.list

国内镜像源配置示例

根据需求选择以下任意一种镜像源,替换文件内容后保存。

清华源(Tuna)

plaintext 复制代码
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

阿里源(Aliyun)

plaintext 复制代码
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

中科大源(USTC)

plaintext 复制代码
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

网易源(163)

plaintext 复制代码
deb http://mirrors.163.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jammy-backports main restricted universe multiverse

更新软件源

修改完成后运行以下命令使更改生效:

bash 复制代码
sudo apt update

注意事项

  • 版本代号 :确保使用jammy(Ubuntu 22.04),其他版本需替换对应代号(如20.04为focal)。
  • 网络环境:虚拟机需检查网络模式(如VMware的NAT模式),物理机确保网络连通。
  • 协议选择 :部分镜像源支持httphttps,推荐优先使用https协议。
相关推荐
w67820076 小时前
Prisma不能优雅的支持DTO,试试Vona ORM吧
linux·运维·ubuntu
PC2005-cloud13 小时前
Windows 下 WSL2 + Docker Desktop + Ubuntu 开发环境搭建指南
windows·ubuntu·docker
_张一凡14 小时前
Ubuntu 完美安装 FT_SCServo_Debug_Qt 飞特SCS_STS舵机调试工具
linux·ubuntu·舵机调试
ZSTU_呆大鹅14 小时前
VMware 虚拟机 + Ubuntu24.04 的缩略图服务冲突
ubuntu
蛊明14 小时前
一台老 ThinkPad 的系统博物馆:Windows、Ubuntu、UOS、Kylin多系统共存方案
windows·ubuntu·kylin
夫唯不争,故无尤也15 小时前
Ubuntu阿里云服务器一键安装RustDesk指南
服务器·ubuntu·阿里云
手揽回忆怎么睡15 小时前
Ubuntu 22.04 64位安装MinIO
linux·前端·ubuntu
AnsonNie1 天前
Ubuntu系统安装裕太微YT6801网卡驱动【笔记】
笔记·ubuntu
小小的木头人2 天前
Ubuntu 使用 udev + systemd + UUID 实现 USB 硬盘自动挂载
linux·运维·ubuntu
千河殇 多想和她3 天前
如何在Reaonix中使用CodeGraph以及CodeGraph效果实测经验分享
linux·运维·ubuntu