Linux:配置Ubuntu系统的镜像软件下载地址

一、原理介绍

好处:从国内服务器下载APT软件,速度快。

二、配置

我这里配置的是清华大学的镜像服务器地址
https://mirrors.tuna.tsinghua.edu.cn/


1、备份文件

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

2、清空sources.list

bash 复制代码
echo '' > /etc/apt/sources.list
cat /etc/apt/sources.list

3、配置地址

bash 复制代码
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src 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-src 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-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

4、更新apt软件

bash 复制代码
sudo apt-get update
相关推荐
张洛闻Eren5 小时前
MySQL 维护稳定系统【MySQL第二课】
linux·数据库·mysql·云原生
ltl5 小时前
Linux 异步 I/O:epoll 与 io_uring 对比
linux
ltl5 小时前
压缩算法工程实践:吞吐、比率与 CPU 权衡
linux
fiveym6 小时前
01 - iPXE + Clonezilla 网络装机原理解析
linux·运维·服务器·网络
-今昭-8 小时前
Ansible
linux·运维·ansible
sudebao点com8 小时前
一次“Google 能打开,FlexTV 打不开”的 DNS 故障排查:从 curl 超时到完整证据链
windows·macos·https·cdn·dns·nslookup·网络排错
mounter6259 小时前
MACsec 全景解析:从技术演进、核心架构到 DPU 硬件卸载与 K8s 大规模调度实战
linux·kubernetes·linux kernel·kernel·macsec
IT邦德10 小时前
Dify1.6基于ubuntu系统的部署实战
linux·运维·ubuntu
非凡ghost11 小时前
分区助手:Windows 磁盘管理的“瑞士军刀“,分区调整不再怕丢数据
服务器·windows·电脑·软件需求
吠品11 小时前
Java byte数组与String互转:编码细节与踩坑记录
java·linux·服务器