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协议。
相关推荐
MIXLLRED2 小时前
随笔——用指令打开与复制ubuntu的文件
linux·ubuntu
飘忽不定的bug2 小时前
重启Lubuntu系统出现桌面背景变成黑色问题
linux·ubuntu
smile_5me2 小时前
RK3588 Ubuntu显示异常
linux·运维·ubuntu
蜡台2 小时前
window11 安装WSL 和 Ubuntu-24.04, Vscode 中使用WSL
linux·vscode·ubuntu·wsl
thinkpad12345678903 小时前
Docker 安装(Ubuntu 22.04 / jammy)步骤总结 + 常见错误处理
服务器·ubuntu·docker
weixin_4566469911 小时前
基于火山引擎 Ubuntu 24.04 预制镜像 30 分钟部署 OpenClaw 飞书办公助手
ubuntu·飞书·火山引擎
YuQiao030311 小时前
Ubuntu怎么弄得像windows:Dash to Panel
linux·ubuntu·dash
和平宇宙11 小时前
Openclaw记录01.老旧电脑部署openclaw
ubuntu·openclaw