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
相关推荐
uoscn6 分钟前
Skipping xxx as repository xxxx doesn‘t support architecture ‘i386‘
linux·u-boot
大聪明-PLUS15 分钟前
Docker 内部机制:深入剖析
linux·嵌入式·arm·smarc
张泽腾6616 分钟前
Ubuntu 扩容
linux·服务器·嵌入式硬件
轩轩Aminent17 分钟前
WSL 中的 Ubuntu 系统中使用 Docker
ubuntu·docker·eureka
RedMery20 分钟前
Ubuntu切换wayland和x11
linux·运维·ubuntu
uoscn35 分钟前
Ubuntu24.04无操作卡死,无法唤醒问题以及内核版本切换记录
linux·ubuntu
一个写python的菜鸟1 小时前
华为服务器安装Todesk
linux·运维·服务器
小曾同学.com1 小时前
认识Linux 的shebang行,一个特殊的注释行
linux·解释器·shebang·/usr/bin/env
大猫和小黄1 小时前
Windows环境下使用Nacos搭建若依(RuoYi)微服务版完整指南
windows·微服务·架构
Thexhy1 小时前
CentOS7安装Redis全攻略
linux·经验分享·redis·学习