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协议。
相关推荐
JasonHuan11237 小时前
Hyper-V-三台虚拟机安装启动使用完全指南
linux·ubuntu·hyper-v·虚拟机
牢姐与蒯8 小时前
Linux进程(三)之进程状态_僵尸孤儿
linux·运维·服务器·ubuntu·c
lskblog9 小时前
Ubuntu 18.04 安装 LibreOffice(用于 Word 在线预览转换)
java·linux·python·ubuntu·word·php·laravel
明王明王1 天前
Ubuntu 26.04 使用 Windows Spotlight:给 Bing Wallpaper 加上 Spotlight 支持
linux·windows·ubuntu
江湖有缘1 天前
Docker开源项目: 基于Ubuntu系统部署ExpenseOwl自托管记账工具实战教程
ubuntu·docker·开源
一直C1 天前
【数据结构】哈希表+算法复杂度与经典排序查找(C语言)
java·linux·开发语言·数据结构·算法·ubuntu·散列表
kobe_OKOK_1 天前
ubuntu server 打包成一个压缩文件,并且在另一台电脑中解压缩
服务器·数据库·ubuntu
敲代码还房贷1 天前
安装wsl报错:HCS_E_HYPERV_NOT_INSTALLED
linux·python·ubuntu
一直C1 天前
【Linux应用编程】深入理解Linux多任务机制:进程原理、状态转换与进程控制实战
linux·开发语言·算法·ubuntu·vim·visual studio code
智者向内寻求力量1 天前
【记录】ubuntu 24.04 安装在levnoval PC上之后,蓝牙设备找不到解决方法
linux·服务器·ubuntu