Ubuntu(20.04 LTS)更换镜像源

news2024/9/22 19:24:59

此换镜像源方法只适用x86_64架构的系统,其他架构的系统参考ubuntu-ports的方法

1、备份文件

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bk

2、创建新文件 

sudo vi /etc/apt/sources.list

根据自己系统版本选择下面对应的镜像源添加到新文件中(记得保存再退出

版本代号可用lsb_release -a 查看

 ubuntu 14.04 LTS (trusty) (EOL)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse

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

ubuntu 16.04 LTS (xenial) (EOL)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse

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

ubuntu 18.04 LTS (bionic) 

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse

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

ubuntu 20.04 LTS (focal) 

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

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

ubuntu 22.04 LTS (jammy)

# 默认注释了源码镜像以提高 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

ubuntu 23.04 (lunar)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ lunar-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ lunar-security main restricted universe multiverse

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

 ubuntu 23.10 (mantic)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ mantic-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ mantic-security main restricted universe multiverse

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

ubuntu 24.04 (noble)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse

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

其他镜像源:

阿里云 

 中科大源

3、更新软件包及系统 

sudo apt-get update
sudo apt-get upgrade -y

参考文档点这里 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1990118.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

智能指针--

智能指针简介 头文件&分类 智能指针都在memory中, 有auto_ptr, unique_ptr, shared_ptr, weak_ptr 智能指针发展史 C++98就有智能指针了(auto_ptr) c++11前,智能指针主要靠bo…

FPGA开发——在Quartus中实现对IP核的PLL调用

一、简介 PLL主要由鉴相器(PD)、环路滤波器(LF)和压控振荡器(VCO)三部分组成。鉴相器检测输入信号与VCO输出信号的相位差,并输出一个与相位差成正比的电压信号。该信号经过环路滤波器滤除高频噪…

esp32学习笔记

前言:学习视频链接放在最后,开发方式为esp32Arduino,使用型号为ESP32-WROOM-32,引脚功能分配图如下。 #esp32介绍 GPIO的引脚默认情况下,只能当做普通功能引脚使用,也就是只能输入,输出&#x…

git 常用指令(创建分支、提交分支、解决冲突)

1. 初始化git 将你的代码放入你创建的文件中&#xff0c;执行 git init(前提你电脑安装过git哈)2. 查看当前项目git 状态 git status 3. 将代码添加到暂存区 git add . &#xff08;提交所有修改的代码&#xff0c;如果向指定提交使用&#xff1a;git add <文件名>&am…

SQL语句创建数据库(增删查改)

SQL语句 一.数据库的基础1.1 什么是数据库1.2 基本使用1.2.1 连接服务器1.2.2 使用案例 1.2 SQL分类 二.库的操作2.1 创建数据库2.2 创建数据库示例2.3 字符集和校验规则2.3.1 查看系统默认字符集以及校验规则2.3.2查看数据库支持的字符集2.3.3查看数据库支持的字符集校验规则2…

【RTOS面试题】ISR中可以使用互斥锁和信号量吗?

在中断服务程序&#xff08;ISR, Interrupt Service Routine&#xff09;中直接使用互斥锁&#xff08;mutex&#xff09;和信号量&#xff08;semaphore&#xff09;是有风险的&#xff0c;因为这些同步机制通常不是中断安全的。但是&#xff0c;可以通过一些方法来安全地在 I…

QWT+Qt Creator+MSVC的配置与使用

目录 一、介绍 二、QWT下载 三、QWT编译 3.1 设置构建套件 3.2 修改QWT相关文件 3.3 进行QWT编译 四、QWT配置 4.1 配置QWT的lib文件 4.2 配置QWT的dll文件 4.3 配置QWT的designer的dll文件 五、代码实验 一、介绍 QWT&#xff0c;全称是Qt Widgets for Technical…

Python 异步编程:Asyncio 实现原理

常见的并发模型 多进程/多线程异步ActorPub/Sub Python 异步的基石&#xff1a;协程 协程简介 概念&#xff1a;协作式多任务的子程序&#xff0c;用户态线程或微线程&#xff08;Coroutine&#xff09;。 特点&#xff1a;子程序执行可以中断&#xff0c;恢复后不会丢失之…

uniapp 荣耀手机 没有检测到设备 运行到Android手机 真机运行

背景&#xff1a; 使用uniapp框架搭建的项目&#xff0c;开发的时候在浏览器运行&#xff0c;因为项目要打包成App&#xff0c;所以需要真机联调&#xff0c;需要运行到Android手机&#xff0c;在手机上查看/运行项目。通过真机调试才能确保软件开发的准确性和页面显示的完整性…

mac 2k显示器 配置

前言 今年5月份买了一个2k显示器&#xff0c;刚收到的时候发现只有一个1080 x 720&#xff08;HiDPI&#xff09;分辨率是人眼看起来比较舒服的&#xff0c;于是一直用着。但是直到开始写前端代码的时候&#xff0c;我才发现&#xff0c;网页在2k显示器和内建显示器的布局竟然…

Python 循环引用与内存泄漏:深度解析

Python 循环引用与内存泄漏&#xff1a;深度解析 在Python编程中&#xff0c;循环引用和内存泄漏是两个需要特别注意的问题。本文将深入探讨Python中的循环引用现象、其导致的内存泄漏问题&#xff0c;并提供详细的解决思路与方法。同时&#xff0c;我们还将分析一些常见场景&…

【CSDN平台BUG】markdown图片链接格式被手机端编辑器自动破坏(8.6 已修复)

文章目录 bug以及解决方法bug原理锐评后续 bug以及解决方法 现在是2024年8月&#xff0c;我打开csdn手机编辑器打算修改一下2023年12月的一篇文章&#xff0c;结果一进入编辑器&#xff0c;源码就变成了下面这个样子&#xff0c;我起初不以为意&#xff0c;就点击了发布&#…

【IoT NTN】面向 5G/6G 卫星:NTN 标准发展、关键技术与未来思考

目录 国际标准化进展 架构及关键技术 5GNTN组网架构 关键技术 1、时频同步技术 2、覆盖增强技术 3、移动性管理技术 4、混合自动重传请求技术 5、自适应调制与编码技术 挑战与潜在解决方案 星地协同全域覆盖模型 星地协同多维资源调度 星地协同多层卫星路由 星地…

网络主播进入国家职业分类!1500万主播将有新身份

在营销策划界摸爬滚打十多年的我&#xff0c;最近可是被一则劲爆消息给震撼到了——国家正式官宣了19个全新职业&#xff0c;这可是职场版图的一次大扩张啊&#xff01; 其中最让人眼前一亮的是&#xff0c;网络主播竟然堂而皇之地登上了新职业的大舞台&#xff0c;正式“转正…

【多线程-从零开始-陆】wait、notify和notifyAll

线程饿死 一个或多个线程因为无法获得执行所需的资源&#xff08;如CPU时间、锁、或其他同步控制&#xff09;而被长时间阻塞或延迟执行的情况。尽管这些线程可能处于可执行状态并且已经准备好运行&#xff0c;但由于资源分配的不均衡或调度策略的问题&#xff0c;它们无法获得…

快讯 | 单卡4090显卡即可解锁视频生成,智谱AI CogVideoX模型开源!

在数字化浪潮的推动下&#xff0c;人工智能&#xff08;AI&#xff09;正成为塑造未来的关键力量。硅纪元视角栏目紧跟AI科技的最新发展&#xff0c;捕捉行业动态&#xff1b;提供深入的新闻解读&#xff0c;助您洞悉技术背后的逻辑&#xff1b;汇聚行业专家的见解&#xff0c;…

认识RAID磁盘阵列

文章目录 1、RAID磁盘阵列介绍2、多种RAID级别RAID 0 &#xff08;条带化存储&#xff09;RAID 1 &#xff08;镜像存储&#xff09;RAID 5RAID 6RAID 10&#xff08;先做镜象&#xff0c;再做条带&#xff09;RAID 01&#xff08;先做条带&#xff0c;再做镜象&#xff09;区别…

leetcode日记(64)最小覆盖子串

很复杂的题目&#xff0c;无论是思路还是实践都很难… 思路还是看了答案&#xff08;&#xff1f;&#xff09;设定两个指针“框”出一串字符串&#xff0c;初始两个指针都指在s的零位&#xff0c;先移动下指针&#xff0c;直到使框出的字符串中包含t中所有字符串&#xff0c;…

c# 排序、强转枚举

List<Tuple<double,int>> mm中doble从小到大排序 mm本身排序 在C#中&#xff0c;如果你有一个List<Tuple<double, int>>类型的集合mm&#xff0c;并且你想要根据Tuple中的double值&#xff08;即第一个元素&#xff09;从小到大进行排序&#xff0c;同…

TCP全队列连接,tcpdum抓包

TCP全队列连接&#xff0c;tcpdum抓包 1. listen的第二个参数作用2. 理解全连接队列&#xff08;原理&#xff09;3. 为什么要有全连接队列并且队列长度要适当4. 使用不tcpdump 进行抓包&#xff0c;分析TCP过程&#xff08;三次握手&#xff0c;四次挥手&#xff09;4.1安装tc…