• Ubuntu(20.04 LTS)更换镜像源


    此换镜像源方法只适用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)

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse

    ubuntu 16.04 LTS (xenial) (EOL)

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

    ubuntu 18.04 LTS (bionic) 

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

    ubuntu 20.04 LTS (focal) 

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

    ubuntu 22.04 LTS (jammy)

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

    ubuntu 23.04 (lunar)

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ lunar-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ lunar-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lunar-proposed main restricted universe multiverse

     ubuntu 23.10 (mantic)

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ mantic-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ mantic-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-proposed main restricted universe multiverse

    ubuntu 24.04 (noble)

    1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
    3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
    4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
    5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
    6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
    7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
    8. # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    9. deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
    10. # deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
    11. # 预发布软件源,不建议启用
    12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
    13. # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse

    其他镜像源:

    阿里云 

     中科大源

    3、更新软件包及系统 

    1. sudo apt-get update
    2. sudo apt-get upgrade -y

    参考文档点这里 

     

  • 相关阅读:
    java.io.IOException: FIS_AUTH_ERROR in Android Firebase
    gRPC学习笔记(一)
    摔倒检测综述
    秋招在线人才测评考什么内容?
    【云笔记篇】Microsoft OneNote笔记插件推荐OneMore
    【实测】Python 和 C++ 下字符串查找的速度对比
    &arr(&数组名)和arr(数组名)的区别|内附具体实例(新手易懂)
    method.isAnnotationPresent(Xxx.class)一直为null
    插件收集(idea Communtity Edtion)
    python珍藏宝藏学习资料
  • 原文地址:https://blog.csdn.net/Fang_Alin/article/details/140956371