ubuntu换镜像源(ubuntu换源)

news2024/9/21 0:45:52

ubuntu换镜像源(ubuntu换源)



文章目录

  • ubuntu换镜像源(ubuntu换源)
    • 1. 备份镜像源文件
    • 2. 根据不同 ubuntu 版本设置不同的镜像源
      • 2.1 focal 版本镜像源
      • 2.2 bionic 版本镜像源
      • 2.3 ubuntu 自带源:
    • 参考文献


1. 备份镜像源文件

  • 备份镜像源设置文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  • 编辑镜像源设置文件
sudo gedit /etc/apt/sources.list

2. 根据不同 ubuntu 版本设置不同的镜像源

  • ubuntu 根据系统版本的不同其设置的镜像源也不同,版本有 focal 和 bionic 等,具体换源方式如下:
  • 使用如下命令,查询自己的Ubuntu系统属于哪种版本:
 lsb_release -c 

在这里插入图片描述

2.1 focal 版本镜像源

  • 复制下面的所有内容替换掉原文件中的所有内容(一次只可以选一个镜像源,根据你的情况选)
# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# 清华园
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
  • 然后再执行更新源命令:
sudo apt-get update
sudo apt-get upgrade

2.2 bionic 版本镜像源

#  阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
 # 清华源
 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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
 deb-src https://mirrors.tuna.tsinghua.edu.cn/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
#  中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

2.3 ubuntu 自带源:

#deb cdrom:[Ubuntu 20.04.3 LTS _Focal Fossa_ - Release amd64 (20210819)]/ focal main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal universe
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

参考文献

1. ubuntu换镜像源(ubuntu换源)- Fighting_1997 - CSDN
2. Ubuntu20.04 错误提醒:无法修正错误

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

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

相关文章

数据库连接 ---MySQL的总结(八)

数据库连接 —MySQL的总结(八) mysql使用在c编程之中使用,需要调用官方c库进行使用。 库的安装 库文件,安装mysql的c链接库 yum install mysql-server接口介绍 初始化 MYSQL *mysql mysql_init(nullptr);连接 mysql_real_conn…

“智汇新算力,众启Z力量”惠普发布全新一代Z系列工作站,共赢算力黄金时代

5月23日, “智汇新算力,众启Z力量”惠普Z系列新品发布会在上海盛大举行。本次发布会上,惠普Z 系列工作站焕新升级,以高算力、强稳定、强拓展的产品及解决方案,帮助各行业用户专注自身领域、驾驭复杂工作,从…

HNU-电路与电子学-小班2

第二次讨论 讨论题目: 1、电子秤的电桥电路可以分别用 1 个压控电阻、 2 个压控电阻、 3 个压控电阻、 4 个压控电阻实现吗?试写出每种实现的 U AB 输出表达式,并分析哪种实现电桥 电压的灵敏度(SV/ △ R )高。 …

【Python Tableau】零基础也能轻松掌握的学习路线与参考资料

一、学习路线 Python和Tableau都是当前市场上非常热门的数据分析和可视化工具。下面是Python Tableau的学习路线: 学习Python基础知识:Python是一门非常易学易用的编程语言,可以选择相应书籍进行学习,如《笨办法学Python》、《Py…

Node.js中Buffer的一些实现原理

1.前言 在ES6之前,JavaScript无法直接处理二进制数据,Node.js为了弥补这个不足引入了 Buffer,其是Node.js的核心模块之一,底层实现基于C。本文将从 Node.js v14.20.0 的源码分析 Buffer 的一些实现原理。 2.ArrayBuffer 在介绍…

Visual Studio插件DevExpress CodeRush v22.1- 支持C# 10

DevExpress CodeRush是一个强大的Visual Studio .NET 插件,它利用整合技术,通过促进开发者和团队效率来提升开发者体验。为Visual Studio IDE增压、消除重复的代码并提高代码质量,可以快速思考、自动化测试、可视化调试和重构。 CodeRush v2…

资深程序员深度体验ChatGPT一周发现竟然....

周一打卡上班,老板凑到我跟前:“小李啊,这周有个新需求交给你做一下,给我们的API管理平台新增一个智能Mock的功能...”。我条件反射般的差点脱口而出:“这个需求做不了..”。不过在千钧一发之间,我想起了最…

【文章学习系列之技巧】Network Slimming

本章内容 文章概况问题来源方法实验结果总结 文章概况 这是一篇2017年发表于ICCV的一篇论文。该论文指出深度卷积神经网络的应用受到了高计算成本的阻碍,并提出一种修剪模型结构的方式用于降低这种成本,使得模型大小减小、运行内存减小且不降低精度的情…

http\https协议

前言 小亭子正在努力的学习编程,接下来将开启javaEE的学习~~ 分享的文章都是学习的笔记和感悟,如有不妥之处希望大佬们批评指正~~ 同时如果本文对你有帮助的话,烦请点赞关注支持一波, 感激不尽~~ 目录 前言 一、 认识http协议 1.概念 1.1…

ChatGPT APP Plus升级全记录:购买礼品卡、兑换和处理失败

大家好,我是可夫小子,《小白玩转ChatGPT》专栏作者,关注AIGC、读书和自媒体。 在上一篇《ChatGPT APP来了,支持语音输入,还可以直接订阅Plus账号》文章中,我介绍了ChatGPT App下载安装教程。本文主要介绍怎…

YOLO中的值得借鉴的思想

关键理论的理解,后面会补充结构等。 1.YOLO1中将图像划分为7*7个网格,每个网格都预测网格中的的类别(是什么物体),以及预测到的物体所对应的框(四个位置量,一个置信度),所…

一、尚医通预约下单

文章目录 一、预约下单1、需求分析1.1订单表结构1.2下单分析 2、搭建service-order模块2.1 搭建service-order模块2.2 修改配置2.3 启动类2.4配置网关 3、添加订单基础类3.1 添加model3.2 添加Mapper3.3 添加service接口及实现类3.4 添加controller 4、封装Feign调用获取就诊人…

【Redis】聊一下Redis事务以及watch机制

我们知道熟悉MySQL的同学,一定了解ACID属性。ACID分别对应四种属性,但是Redis的事务和ACID属性有什么不一样的地方嘛,我们来深入探讨下。 Redis事务和MySQL事务的区别 ACID的本质是保证了事务执行前后对结果的保证,以及数据状态…

二、数据结构2:双链表 模板题+算法模板(双链表)

文章目录 算法模板双链表题目模板 模板题双链表原题链接题目思路题解 算法模板 双链表题目模板 // e[]表示节点的值,l[]表示节点的左指针,r[]表示节点的右指针,idx表示当前用到了哪个节点 int e[N], l[N], r[N], idx;// 初始化 void init()…

Android进阶 View事件体系(一):概要介绍和实现View的滑动

Android进阶 View事件体系(一):概要介绍和实现View的滑动 内容概要 本篇文章为总结View事件体系的第一篇文章,将介绍的内容主要有: 什么是View和ViewGroupAndroid中View的坐标轴手势检测和速度检测如何实现View的滑动…

【ZYNQ】ZYNQ7000 UART 控制器及驱动应用示例

UART 简介 我们在使用 PS 的时候,通常会添加 UART 控制器,用于打印信息和调试代码。除此之外,PS 在和外 部设备通信时,也会经常使用串口进行通信。 UART 控制器 UART 控制器是一个全双工异步收发控制器,ZYNQ 内部包…

ssm实现发送邮箱功能

参考:ssm整合JavaMail发送邮件_ssm整合mimemessage_ds_surk的博客-CSDN博客 我在这位前辈写的博客的基础上进行讲解完善,避免踩坑。 我的jdk版本:1.8.0_333 1、引入依赖 相信很多朋友都卡在这里: 1、没有JavaMailSenderImpl类 2、…

数字逻辑 期末

概述 教材:《电子技术基础(数字部分)》 第五版 7400系列是TTL型芯片,商用型 数制 十进制->二进制 除2取余法&乘2取整法(注意精度,但计科简单不考) 十六进制->二进制 一位变四位 八…

Linux下串口编程

Linux下串口编程 Linux下的串口编程是通过串口设备文件和串口通信的系统调用函数来实现的。Linux下的串口设备文件通常为/dev/ttyS或/dev/ttyUSB(*表示数字),这些设备文件代表了对应的串口硬件设备。 在进行串口编程之前,需要先打开并初始化串口设备,其中包括设置波特率…

Linux 在桌面添加快捷启动图标(可添加至收藏夹)

0 背景 在 Ubuntu 系统下启动程序一般在 Terminal 通过输入指令启动,如 ./cfw。对于常用的程序,为了方便,创建桌面快捷图标 .desktop。为了让图标能够添加在收藏栏中,将 .desktop 融入桌面环境。 1 创建 .desktop 文件 参考&…