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
相关推荐
胡斌附体7 分钟前
linux测试端口是否可被外部访问
linux·运维·服务器·python·测试·端口测试·临时服务器
愚润求学15 分钟前
【Linux】自旋锁和读写锁
linux·运维
大锦终17 分钟前
【Linux】常用基本指令
linux·运维·服务器·centos
qq_3938282224 分钟前
电脑休眠设置
windows·电脑·软件需求
IT项目管理28 分钟前
达梦数据库DMHS介绍及安装部署
linux·数据库
知北游天41 分钟前
Linux:多线程---深入互斥&&浅谈同步
linux·运维·服务器
Gappsong87443 分钟前
【Linux学习】Linux安装并配置Redis
java·linux·运维·网络安全
try2find1 小时前
移动conda虚拟环境的安装目录
linux·运维·conda
笑衬人心。1 小时前
Ubuntu 22.04 修改默认 Python 版本为 Python3 笔记
笔记·python·ubuntu
码农101号2 小时前
Linux中容器文件操作和数据卷使用以及目录挂载
linux·运维·服务器