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
相关推荐
木欣欣粉皮20 分钟前
Ubuntu使用图片
linux·ubuntu
迎風吹頭髮22 分钟前
Linux服务器编程实践27-详解TCP状态转移:从LISTEN到TIME_WAIT的完整路径
linux·服务器·网络
初听于你2 小时前
深入了解—揭秘计算机底层奥秘
windows·tcp/ip·计算机网络·面试·架构·电脑·vim
森G2 小时前
2一、u-boot下载编译
linux·arm开发
Ching·2 小时前
linux系统编程(十③)RK3568 socket之 TCP 服务器的实现【更新客户端断开重连依旧可以收发】
linux·服务器·tcp/ip·rk3568
报错小能手3 小时前
linux学习笔记(35)C语言连接mysql
linux·笔记·学习
心一信息3 小时前
grafana及zabbix在linux上的部署
linux·zabbix·grafana
deng-c-f3 小时前
Linux C/C++ 学习日记(27):KCP协议(三):源码分析与使用示例
linux·服务器·网络·c++·网络编程·kcp
wangjialelele4 小时前
端口号、常见协议和套接字
linux·运维·服务器·c语言·网络
IoT小趴菜4 小时前
操作无法完成,因为磁盘管理控制台视图不是最新状态。请使用刷新任务刷新此视图。如果问题仍然存在,请关闭磁盘管理控制台,然后重新启动磁盘管理或重新启动计算机
windows·存储