ubuntu换镜像源(ubuntu换源)

这篇具有很好参考价值的文章主要介绍了ubuntu换镜像源(ubuntu换源)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

ubuntu换镜像源(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 

ubuntu换镜像源(ubuntu换源)

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 错误提醒:无法修正错误文章来源地址https://www.toymoban.com/news/detail-466665.html

到了这里,关于ubuntu换镜像源(ubuntu换源)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • VScode中添加头文件和源文件的方法

            在正常情况下,若同一文件夹下若头文件、源文件、和主要代码在同一文件夹下,则可以正常运行程序。 如图(此为Visual Studio 示例):   编译结果(无报错):     但在VScode中,同样的使用方式会产生报错。 如下:    main.c:  myheadfile.h: myheadfile.c:    报错如

    2023年04月09日
    浏览(47)
  • Visual Studio C++ 的 头文件和源文件

    在Visual Studio C++中,头文件(Header Files)和源文件(Source Files)是两种不同的文件类型,用于组织和管理C++代码。 头文件(Header Files): 后缀名为 .h 或 .hpp 的文件,例如 example.h 。 包含类、结构体、函数的声明、宏定义和类型定义等。 通常用于存放函数原型、类的声明、常

    2024年02月07日
    浏览(56)
  • CMake获取目录下所有源文件

    1、aux_source_directory指令         aux_source_directory( dir variable ) 比如:         aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} ALL_SOURCE) , 这样将当前目录所有的源文件(.cpp 和.c文件)都放到了ALL_SOURCE变量中,但是头文件并没有被包括进去,若在头文件有函数的实现部分,采用这

    2024年02月15日
    浏览(49)
  • 【C++】源文件.cpp和头文件.h分离编程

    将C++代码分为头文件(.h)和源文件(.cpp)的做法有以下几个好处: 模块化和代码组织:将函数和类的声明(包括函数原型、类的成员和属性等)放在头文件中,将函数和类的实现(具体的函数逻辑、成员函数的定义等)放在源文件中。这种分离有助于对代码进行模块化和组

    2024年02月09日
    浏览(39)
  • Linux--多个源文件编译成同一个可执行文件

    写法一:不推荐 写法二、推荐 $@: 代表目标文件    $^: 代表生成目标文件的所有源文件

    2024年02月15日
    浏览(64)
  • Vivado中如何修改IP源文件

    前一篇文章是通过改变JESD204B IP的设置,在Shared Logic里勾选in example design,来避免共用输入时钟的问题。那么还有没有别的办法呢?有没有更直接点的实现方式呢? 答案是肯定的:可以 直接修改IP,将IBUFDS从IP里移出去 ,放到外面就可以共用了。修改IP是一个比较复杂的办法,

    2024年02月11日
    浏览(86)
  • Lua之Lua源文件批量转换为luac字节码文件

    准备的工具:luac.exe  CSDN https://mp.csdn.net/mp_download/manage/download/UpDetailed Unity版:

    2024年02月11日
    浏览(40)
  • 教你怎么在电脑端下载西瓜视频源文件

    家里长辈平时爱用西瓜视频,看到喜欢的广场舞就会收藏,甚至想下载到视频机,晚上去广场跟着跳🤣。 这时计算机专业出身的我,就派上用场了。不废话,直接上手: 打开西瓜视频官网,搜索到想要的视频 打开 F12(开发者工具) 切换到移动端模式,刷新页面 在 Network

    2024年02月05日
    浏览(276)
  • 【STM32学习笔记】(5)—— STM32工程添加源文件和头文件

    STM32的工程文件构成较为复杂,同时为STM32工程文件添加源文件和头文件也是较为复杂的,下面就由此文章来介绍怎么给STM32工程添加源文件(.c)与头文件(.h),以跑马灯实验为例。 1、在Template工程文件夹下面新建一个 HARDWARE 的文件夹,用来存储以后与硬件相关的代码,然

    2024年02月16日
    浏览(47)
  • Unity Netcode for GameObjects多人联机(源文件)

    一、安装Netcode for Gameobjects Netcode for Gameobjects是Unity新推出的联机解决方案,该解决方案目前处于初期,相关功能不是很完善,但是用起来还不错。下面介绍一下相关用法。 首先下载安装Netcode for Gameobjects,其官方网站为Netcode for Gameobjects,安装方式也很简单,新建好Unity项目

    2024年02月03日
    浏览(64)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包