From 0da6eb5b4b891eaf6b8a615beef207b5fd7c0690 Mon Sep 17 00:00:00 2001 From: SuperManito <68613938+SuperManito@users.noreply.github.com> Date: Fri, 7 Jun 2024 04:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- README.md | 2 +- docs/index.md | 14 +++++----- docs/mirrors/index.md | 8 +++--- docs/theme/partials/comments.html | 3 ++- docs/use/command-options.md | 44 ++++++++++++++++++++++--------- docs/use/index.md | 4 +-- giscus.json | 3 +++ requirements.txt | 4 +-- 9 files changed, 54 insertions(+), 30 deletions(-) create mode 100644 giscus.json diff --git a/LICENSE b/LICENSE index 12121ae..2833ae0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 SuperManito +Copyright (c) 2024 SuperManito Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9a76431..684ec8f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@  Ubuntu - 14.04 ~ 23 + 14.04 ~ 24  Kali Linux diff --git a/docs/index.md b/docs/index.md index 4b09089..c06fb07 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@ --- -title: LinuxMirrors · 让换源更简单 +title: LinuxMirrors · 使换源更简单 comments: true glightbox: false hide: @@ -24,21 +24,21 @@ hide: --- 考察了国内镜像站的系统适配情况,测试了下载速度与IPv6协议的兼容性 - 另外提供全网收集的中国大陆教育网镜像站、海外镜像站可供选择 + 另外,提供了全网收集的中国大陆教育网镜像站和海外镜像站供选择 - :material-rocket-launch-outline:{ .lg .middle } __低技术成本__ --- - 无需掌握相关技术,文档提供了全面的相关知识储备与操作指引 - 提供了一些常见问题的解决方法 + 无需掌握相关技术,文档提供了全面的相关知识储备和操作指引 + 还提供了一些常见问题的解决方法 - :octicons-command-palette-24:{ .lg .middle } __脚本一键运行__ --- - 脚本让换源更简单,默认通过交互进行更换,根据用户选择自动配置 - 并且提供了强大的命令选项,可应用于自动化项目实现无交互操作 + 脚本使换源变得更简单,通过交互默认进行更换,并根据用户选择自动配置 + 同时,提供了强大的命令选项,可用于自动化项目以实现无交互操作 - :material-scale-balance:{ .lg .middle } __开源,MIT__ @@ -59,7 +59,7 @@ hide: | 系统名称 | 适配版本 | | --- | :---: | | Debian | 8.0 ~ 13 | -| Ubuntu :material-information-outline:{ title="支持乌班图家族衍生操作系统,例如 优麒麟 Kubuntu 等" } | 14.04 ~ 23 | +| Ubuntu :material-information-outline:{ title="支持乌班图家族衍生操作系统,例如 优麒麟 Kubuntu
此外由于迭代速度较快并不直接支持所有非长期支持(LTS)的版本,具体详见使用文档中的高级用法" } | 14.04 ~ 24 | | Kali Linux | 2.0 ~ 2024 | | Deepin | all | | Armbian | all | diff --git a/docs/mirrors/index.md b/docs/mirrors/index.md index 7e6320f..039cd1b 100644 --- a/docs/mirrors/index.md +++ b/docs/mirrors/index.md @@ -30,11 +30,11 @@ hide: ???+ question "使用帮助" - :supported: 支持    :unsupport: 不支持    :incompatible: 不兼容,表示软件源分支命名不符合脚本默认规则但可以通过命令参数来使用,关于具体用法示例和各操作系统所使用的默认分支名称[详见此处](../use/command-options.md#%E6%8C%87%E5%AE%9A%E8%BD%AF%E4%BB%B6%E6%BA%90%E5%88%86%E6%94%AF) + :supported: 支持    :unsupport: 不支持    :incompatible: 不兼容,表示软件源分支命名不符合脚本默认规则但可以通过命令参数来使用,关于具体用法示例和各操作系统所使用的默认分支名称[详见此处](../use/command-options.md#指定软件源分支) 如果这里没有想使用的镜像站那可以看看其它运行模式和命令选项。软件源的速度区分刷新速度和下行速率,后者才是关键,具体请结合实际地理位置选择尝试,还可以通过[辅助工具网站](#工具网站)进行一些测试 - :material-thumb-up-outline: 使用建议:速度上推荐 `中科大`、`字节跳动(火山引擎)`,地域兼容性上推荐 `腾讯云`、`阿里云`,复杂网络环境下不建议使用容易阻断的镜像站例如 `清华(TUNA)` `浙江大学`,这有违自由软件的初衷 + :material-thumb-up-outline: 使用建议:速度上推荐 `中科大`、`字节跳动(火山引擎)`,地域兼容性上推荐 `腾讯云`、`阿里云`,海外网络环境或复杂网络环境下不建议使用 `清华(TUNA)` `浙江大学` 等容易阻断的镜像站,这有违自由软件的初衷 ??? note "国内教育网软件源列表" @@ -245,9 +245,9 @@ hide: ???+ note "帮助本项目完善更多海外软件源" - 该列表中的软件源参考自 [`Ubuntu 镜像列表`](https://launchpad.net/ubuntu/+cdmirrors "https://launchpad.net/ubuntu/+cdmirrors")、[`Debian 镜像列表`](https://www.debian.org/CD/http-ftp/#mirrors "https://www.debian.org/CD/http-ftp/#mirrors")、[`Fedora Mirror Manager`](https://admin.fedoraproject.org/mirrormanager/mirrors "https://admin.fedoraproject.org/mirrormanager/mirrors") 并且全部经过了有效性验证,但未作实际测试 + 该列表中的软件源参考自 [`Ubuntu 镜像列表`](https://launchpad.net/ubuntu/+cdmirrors "https://launchpad.net/ubuntu/+cdmirrors")、[`Debian 镜像列表`](https://www.debian.org/CD/http-ftp/#mirrors "https://www.debian.org/CD/http-ftp/#mirrors")、[`Fedora Mirror Manager`](https://admin.fedoraproject.org/mirrormanager/mirrors "https://admin.fedoraproject.org/mirrormanager/mirrors") 并且在此之前全部经过了有效性验证,但未作实际测试 - 如果你想补充更多海外软件源或更正当前已有,请修改脚本内的 [`mirror_list_abroad 数组变量`](https://github.com/SuperManito/LinuxMirrors/blame/main/ChangeMirrors.sh#L28 "https://github.com/SuperManito/LinuxMirrors/blame/main/ChangeMirrors.sh#L28") 并按照下面的编辑规范进行修改 + 作者没有精力持续维护列表中的这些海外镜像站,如果你想补充更多海外软件源或更正当前已有,请修改脚本内的 [`mirror_list_abroad 数组变量`](https://github.com/SuperManito/LinuxMirrors/blame/main/ChangeMirrors.sh#L28 "https://github.com/SuperManito/LinuxMirrors/blame/main/ChangeMirrors.sh#L28") 并按照下面的编辑规范进行修改 你可以在确认软件源地址无误后前往 GitHub 仓库提交 [Pull Requests](https://github.com/SuperManito/LinuxMirrors/pulls "https://github.com/SuperManito/LinuxMirrors/pulls"),也可以 :material-source-fork: Fork 仓库后自行定制使用 diff --git a/docs/theme/partials/comments.html b/docs/theme/partials/comments.html index 30d5e47..305ebaf 100644 --- a/docs/theme/partials/comments.html +++ b/docs/theme/partials/comments.html @@ -14,7 +14,8 @@ data-lang="zh-CN" data-loading="lazy" crossorigin="anonymous" - async> + async + > diff --git a/docs/use/command-options.md b/docs/use/command-options.md index b5ac89f..2797fa7 100644 --- a/docs/use/command-options.md +++ b/docs/use/command-options.md @@ -42,7 +42,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ 项目脚本为了适配大的环境不会针对某一镜像站独特的镜像分支名称而单独适配,默认使用的分支名称如下
-| 系统名称 | 版本代号 | +| 系统名称 | 涉及的分支名称 | | --- | :---: | | Debian | debian | | Ubuntu | ubuntu / ubuntu-ports | @@ -64,7 +64,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ 请看下面的例子 -``` { .bash .no-copy title="使用阿里云的 Rocky Linux 软件源" } +``` { .bash title="使用阿里云的 Rocky Linux 软件源" } bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ --source mirrors.aliyun.com \ --branch rockylinux @@ -76,7 +76,9 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ ### 单独更换 EPEL 源 -有些时候你会发现想使用的镜像站没有 epel 镜像仓库,那么你可以在第一次运行脚本时不安装或不更换 epel 源然后再单独执行下面的命令 +!!! info "EPEL (Extra Packages for Enterprise Linux) 是由 Fedora 组织维护的一个附加软件包仓库,它主要适用于除 Fedora 操作系统以外的红帽系 Linux 发行版,配置 EPEL 仓库已成为广大用户的普遍需求,建议默认安装它" + +有些时候你会发现想使用的镜像站没有 epel 镜像仓库,那么你可以在第一次运行脚本时不安装或更换 epel 源然后再单独执行下面的命令 ``` bash bash <(curl -sSL https://linuxmirrors.cn/main.sh) --only-epel @@ -89,6 +91,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --only-epel ``` bash bash <(curl -sSL https://linuxmirrors.cn/main.sh) --use-official-source ``` +> 部分系统不存在官方源例如 `Arch Linux`,届时会自动更换成兼容性较高的阿里云镜像站 ### 自定义 Debian Security 源 @@ -100,18 +103,23 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ --branch-security debian-security ``` -### 指定 Debian 系 Linux 版本代号 +### 指定 Debian 系 Linux 操作系统的版本代号 大多数情况下自定义版本代号用于更换系统版本,请看下面的例子 -``` { .bash title="升级 Debian 至最新 12 版本 Bookworm" } -bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ - --codename bookworm -``` -``` { .bash title="将 Debian 版本切换到测试分支" } -bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ - --codename testing -``` +=== "升级 Debian 至最新 12 版本 Bookworm" + + ``` bash + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename bookworm + ``` + +=== "将 Debian 版本切换到测试分支" + + ``` bash + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename testing + ``` 更换软件源后还需要执行系统更新命令 `apt-get dist-upgrade`,并且建议在更新完成并重启系统后重新执行本换源脚本,因为仅更换软件源配置中的系统版本代号可能会在后期使用时产生一些兼容性问题 @@ -119,6 +127,18 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ sed -i "s/$(lsb_release -cs)/指定版本代号/g" /etc/apt/sources.list ``` +### 更换 Ubuntu EOF版本软件源 + +!!! info "EOF 为生命周期结束的缩写(End Of Life),Ubuntu 迭代速度较快一般非长期支持(LTS)版本的生命周期只有9个月。官方会定期从主仓库移除不在生命周期内的版本仓库目录,届时可能就需要使用镜像站的 `Ubuntu Old Releases` 分支" + +具体版本支持情况详见官方 [Wiki](https://wiki.ubuntu.com/Releases),关于 `Ubuntu Old Releases` 分支的支持情况详见各镜像站 + +``` bash +bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --source mirrors.ustc.edu.cn \ + --branch ubuntu-old-releases +``` + ## 无人值守 不通过交互完成换源操作,需要使用大量命令选项来实现,建议熟悉后再使用 diff --git a/docs/use/index.md b/docs/use/index.md index 0f82f9b..3dfbd10 100644 --- a/docs/use/index.md +++ b/docs/use/index.md @@ -95,13 +95,13 @@ hide: --- - 如果你使用的系统终端界面不支持 `UTF-8` 编码那么将无法正常显示中文内容,导致无法正确选择交互内容。大部分系统都会自动开启该服务,否则请参考[启用方法](help.md#%E5%85%B3%E4%BA%8E%E5%BC%80%E5%90%AF-ssh-%E8%BF%9C%E7%A8%8B%E7%99%BB%E5%BD%95%E7%9A%84%E6%96%B9%E6%B3%95) + 如果你使用的系统终端界面不支持 `UTF-8` 编码那么将无法正常显示中文内容,导致无法正确选择交互内容。大部分系统都会自动开启该服务,否则请参考[启用方法](help.md#关于开启-ssh-远程登录的方法) - :material-numeric-3:{style="color: #3CA7E5" .lg} __如果是在新系统上首次执行脚本__ --- - 当前执行方式依赖 `curl` 指令来获取脚本内容并执行,所以需要先通过包管理工具来安装该软件包,否则会报错 `Command not found`,安装方法详见[常见问题](help.md#%E5%85%B3%E4%BA%8E%E6%8A%A5%E9%94%99-command-not-found),若无法安装就复制[源码](https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)到本地新建`.sh`脚本,然后通过 `bash` 手动执行 + 当前执行方式依赖 `curl` 指令来获取脚本内容并执行,所以需要先通过包管理工具来安装该软件包,否则会报错 `Command not found`,安装方法详见[常见问题](help.md#关于报错-command-not-found),若无法安装就复制[源码](https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)到本地新建`.sh`脚本,然后通过 `bash` 手动执行
diff --git a/giscus.json b/giscus.json new file mode 100644 index 0000000..7a125d0 --- /dev/null +++ b/giscus.json @@ -0,0 +1,3 @@ +{ + "defaultCommentOrder": "newest" +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index aae53f3..00e7dbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -mkdocs-material==9.5.17 -mkdocs-glightbox==0.3.5 +mkdocs-material==9.5.26 +mkdocs-glightbox==0.4.0 mkdocs-exclude-search==0.6.6 \ No newline at end of file