Ubuntu设置国内镜像的全部流程

 更新时间:2024年06月11日 09:14:36   作者:我就是菜  
Ubuntu作为广泛使用的Linux发行版,其默认的镜像源可能因为地理位置和网络问题导致下载速度缓慢,本文将指导用户如何根据自己所在的地理位置,选择并设置最适合的国内镜像源,需要的朋友可以参考下

01.简介

Ubuntu作为广泛使用的Linux发行版,其默认的镜像源可能因为地理位置和网络问题导致下载速度缓慢。本文将指导用户如何根据自己所在的地理位置,选择并设置最适合的国内镜像源。

02.查询版本

使用命令 lsb_release -a 查询自己的系统版本号

icai@CSJMOVE:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy
icai@CSJMOVE:~$

注意Codename 这个发行版代号, Ubuntu的每个发行版都拥有一个独特的代号,开发代号需要与镜像源对应。

03.镜像源(阿里云)

(1)ubuntu 14.04 LTS (trusty) (EOL)

deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

## Not recommended
# deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

(2)ubuntu 16.04 LTS (xenial) (EOL)

deb https://mirrors.aliyun.com/ubuntu/ xenial main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main

deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb https://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universe

(3)ubuntu 18.04 LTS (bionic)

deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

(4)ubuntu 20.04 LTS (focal)

deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
```(5)ubuntu 22.04 LTS (jammy)
```Shell
deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

(5) ubuntu 23.04 (lunar)

deb https://mirrors.aliyun.com/ubuntu/ lunar main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ lunar main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ lunar-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ lunar-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ lunar-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ lunar-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ lunar-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ lunar-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ lunar-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ lunar-backports main restricted universe multiverse

(6)ubuntu 24.04 (noble)

deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse

04.设置方法

(1)备份

sudo cp /etc/apt/sources.list /etc/apt/sources.list.back

(2)编辑

vim /etc/apt/sources.list

(3)更新

sudo apt update
sudo apt upgrade

到此这篇关于Ubuntu设置国内镜像的全部流程的文章就介绍到这了,更多相关Ubuntu设置镜像内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • CentOS7环境搭建python3以及与python2实现共存的方法

    CentOS7环境搭建python3以及与python2实现共存的方法

    这篇文章主要介绍了CentOS7环境搭建python3以及与python2实现共存的方法,结合实例形式简单分析了CentOS7环境下安装Python3的步骤、命令及测试代码示例,非常简单易懂,需要的朋友可以参考下
    2018-06-06
  • Linux获取docker容器中的文件路径的方法

    Linux获取docker容器中的文件路径的方法

    在Linux系统中,Docker容器中的文件路径与宿主机上的文件系统是隔离的,因此我们不能直接使用宿主机的文件系统路径来访问容器内的文件,但是,有几种方法可以让我们获取或操作Docker容器中的文件,本文介绍的非常详细,需要的朋友可以参考下
    2024-11-11
  • Linux系统下netstat命令详细介绍

    Linux系统下netstat命令详细介绍

    大家好,本篇文章主要讲的是Linux系统下netstat命令详细介绍,感兴趣的同学赶快来看一看吧,对你有帮助的话记得收藏一下,方便下次浏览
    2021-12-12
  • Linux提示网络不可达问题

    Linux提示网络不可达问题

    这篇文章主要介绍了Linux提示网络不可达问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2023-12-12
  • PHP程序员玩转Linux系列 nginx初学者引导

    PHP程序员玩转Linux系列 nginx初学者引导

    这篇文章主要为大家详细介绍了PHP程序员玩转Linux系列文章,带大家初步认识一下nginx,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2017-04-04
  • CentOS7安装配置 Redis的方法步骤

    CentOS7安装配置 Redis的方法步骤

    这篇文章主要介绍了CentOS7安装配置 Redis的方法步骤,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2019-04-04
  • 详解Linux进程调度策略

    详解Linux进程调度策略

    这篇文章主要介绍了详解Linux进程调度策略,以及代码实现中重要环节的指点,一起来学习下。
    2017-11-11
  • centos通过yum安装php的教程

    centos通过yum安装php的教程

    这篇文章主要介绍了centos通过yum安装php的教程,本文给大家提到了CentOS 7下Yum安装PHP7.2步骤,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
    2020-01-01
  • Linux利用lsof/extundelete工具恢复误删除的文件或目录

    Linux利用lsof/extundelete工具恢复误删除的文件或目录

    这篇文章主要给大家介绍了关于Linux利用lsof/extundelete工具恢复误删除的文件或目录的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-08-08
  • Ubuntu下Docker CE的安装

    Ubuntu下Docker CE的安装

    今天小编就为大家分享一篇关于Ubuntu下Docker CE的安装,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
    2019-01-01

最新评论