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
相关推荐
胜心缘1 小时前
openEuler 24.03 最小安装后的第一个小时:10 组命令,一份基线清单
linux·运维
胜心缘1 小时前
openEuler 装 nginx:别再开 EPOL 了,它根本不在里面
linux·运维
用户8174480063392 小时前
从零搭建并加固个人博客:阿里云轻量服务器 + Hexo + Nginx 全流程实战
linux
老一岁3 小时前
Redis事务_锁_持久化_主从哨兵
linux·数据库·redis
梓沂3 小时前
零成本替代 FTP:Ubuntu 24.04 搭建 Samba 共享,实现“一人可写,多人只读”
linux·运维·ubuntu
EmbeddedChen3 小时前
Linux 定时任务怎么设置?用 cron 自动执行脚本
linux·crontab·cron
IT小小猪3 小时前
子进程闪黑窗:pythonw 没有控制台,0x08000000 一个参数解决
运维·windows·python·自动化·进程管理
wuminyu4 小时前
OpenJDK学习笔记:Native事件队列与Java回调背压
java·linux·c语言·jvm·c++
Techblog of HaoWANG4 小时前
具身智能机器人专题(4) Docker 实战
linux·运维·ubuntu·docker·容器·机器人·ollama
2501_916007474 小时前
Windows 怎么开发 Swift iOS App?SwiftUI 编译与真机调试和打包 ipa
ide·windows·vscode·ios·个人开发·swift·敏捷流程