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协议。
相关推荐
爱讲故事的1 天前
操作系统第一讲复习:为什么学习操作系统,以及操作系统到底在做什么?
linux·开发语言·windows·学习·ubuntu·c#
我先去打把游戏先1 天前
Ubuntu虚拟机(服务器版本)Git卸载完全教程——彻底移除与清理配置
服务器·git·单片机·嵌入式硬件·物联网·ubuntu·51单片机
shandianchengzi1 天前
【记录】Ubuntu|Ubuntu 26.04 笔记本耗电过快,排查 省电过程
linux·运维·ubuntu
承渊政道1 天前
【MySQL数据库学习】(MySQL数据类型)
数据库·学习·mysql·ubuntu·bash·数据库开发·数据库系统
say_fall1 天前
Linux进程核心概念:命令行参数与环境变量深度解析
linux·运维·服务器·ubuntu
dongdonglele5211 天前
ubuntu 系统x86 架构安装docker,可以使用本地显卡
ubuntu·docker·架构
烛衔溟2 天前
TypeScript 模块与声明文件全解
linux·ubuntu·typescript
00后程序媛2 天前
ubuntu安装qemu和xv6
linux·运维·ubuntu
天疆说2 天前
在 Ubuntu 上安装 NASA GMAT R2026a 轨道设计软件
linux·运维·ubuntu
xiaobobo33302 天前
vscode打开Ubuntu虚拟机中文件资源管理器加载慢
vscode·ubuntu·资源管理器·加载慢