diff --git a/docs/index.en.md b/docs/index.en.md index 7b11599..01ce7fc 100644 --- a/docs/index.en.md +++ b/docs/index.en.md @@ -135,7 +135,7 @@ hide:
-[Get Started](use/index.md){ .md-button .md-button--primary }   [View Mirror List](mirrors/index.md){ .md-button } +[Get Started](use/index.md){ .md-button .md-button--primary }   [Mirror List](mirrors/index.md){ .md-button }
--8<-- "docs/sponsor/main.html" diff --git a/docs/index.md b/docs/index.md index 2bf9b50..1603878 100644 --- a/docs/index.md +++ b/docs/index.md @@ -135,7 +135,7 @@ hide:
-[开 始 使 用](use/index.md){ .md-button .md-button--primary }   [查看软件源列表](mirrors/index.md){ .md-button } +[开 始 使 用](use/index.md){ .md-button .md-button--primary }   [软件源列表](mirrors/index.md){ .md-button }
--8<-- "docs/sponsor/main.html" diff --git a/docs/index.zh-Hant.md b/docs/index.zh-Hant.md index da8a7fb..a0b7424 100644 --- a/docs/index.zh-Hant.md +++ b/docs/index.zh-Hant.md @@ -82,7 +82,7 @@ hide: --- - 腳本透過方向鍵互動逐步引導使用者選擇軟體來源配置,讓換源更簡單 + 腳本透過方向鍵互動逐步引導使用者選擇軟體軟體源配置,讓換源更簡單 此外腳本提供了豐富的命令選項,支援 CI/CD 整合與自動化維運 - :material-pencil-ruler-outline:{ .lg .middle } __高度可自定義__ @@ -97,7 +97,7 @@ hide: --- 項目已設立 MIT 開源授權協議,腳本程式碼完全開源且免費使用 - 請尊重作者的知識成果,傳播時請在顯著位置標註來源或項目地址 + 請尊重作者的知識成果,傳播時請在顯著位置標註軟體源或項目地址 @@ -135,7 +135,7 @@ hide:
-[開 始 使 用](use/index.md){ .md-button .md-button--primary }   [查看軟體源列表](mirrors/index.md){ .md-button } +[開 始 使 用](use/index.md){ .md-button .md-button--primary }   [軟體源列表](mirrors/index.md){ .md-button }
--8<-- "docs/sponsor/main.html" diff --git a/docs/other/index.en.md b/docs/other/index.en.md index 8f6455f..812a968 100644 --- a/docs/other/index.en.md +++ b/docs/other/index.en.md @@ -217,13 +217,6 @@ hide: > Full source format: `:///` - - #### Specify Docker CE Source Address - - ``` { .bash .no-copy } - bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source mirror.example.com/docker-ce - ``` - > Note: The address path must include the Docker CE repository path, i.e., `docker-ce`. - - #### Specify Registry Mirror Address ``` { .bash .no-copy } @@ -285,6 +278,13 @@ hide: [[ $(systemctl is-active docker) == "active" ]] && systemctl restart docker || systemctl enable --now docker ``` + - #### Specify Docker CE Source Address + + ``` { .bash .no-copy } + bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source mirror.example.com/docker-ce + ``` + > Note: The address path must include the Docker CE repository path, i.e., `docker-ce`. + - #### Specify Docker CE Repository The script will automatically detect this in most cases. Specify only if you have special requirements. diff --git a/docs/other/index.md b/docs/other/index.md index f9f4529..4d0fc62 100644 --- a/docs/other/index.md +++ b/docs/other/index.md @@ -232,13 +232,6 @@ hide: > 软件源完整格式 `://<软件源地址(域名或IP)>/<软件源仓库(路径)>` - - #### 指定 Docker CE 软件源地址 - - ``` { .bash .no-copy } - bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source mirror.example.com/docker-ce - ``` - > 注意该地址路径需要包含镜像站的 Docker CE 软件源仓库路径即 `docker-ce` - - #### 指定镜像仓库地址 ``` { .bash .no-copy } @@ -300,6 +293,13 @@ hide: [[ $(systemctl is-active docker) == "active" ]] && systemctl restart docker || systemctl enable --now docker ``` + - #### 指定 Docker CE 软件源地址 + + ``` { .bash .no-copy } + bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source mirror.example.com/docker-ce + ``` + > 注意该地址路径需要包含镜像站的 Docker CE 软件源仓库路径即 `docker-ce` + - #### 指定 Docker CE 软件源仓库 脚本默认会自动判断一般无需指定,除非你有特殊需求 diff --git a/docs/other/index.zh-Hant.md b/docs/other/index.zh-Hant.md index 90d8675..fa86cf6 100644 --- a/docs/other/index.zh-Hant.md +++ b/docs/other/index.zh-Hant.md @@ -152,11 +152,11 @@ hide: --- - 用於控制拉取鏡像的預設來源儲存倉庫,又稱為鏡像加速器,預設為官方容器鏡像倉庫 [Docker Hub](https://hub.docker.com) + 用於控制拉取鏡像的預設軟體源儲存倉庫,又稱為鏡像加速器,預設為官方容器鏡像倉庫 [Docker Hub](https://hub.docker.com) - 由於一些不可抗力的因素,目前中國大陸網路環境無法訪問 [Docker Hub](https://hub.docker.com),因此無法正常拉取鏡像,建議使用下方提到的中國大陸可用鏡像倉庫來源 + 由於一些不可抗力的因素,目前中國大陸網路環境無法訪問 [Docker Hub](https://hub.docker.com),因此無法正常拉取鏡像,建議使用下方提到的中國大陸可用鏡像倉庫軟體源 註:腳本內的指定 WEB 協議互動僅用於控制 `Docker CE` 軟體源,`Docker Registry` 強制使用 `HTTPS` 協議 @@ -193,7 +193,7 @@ hide: | Alibaba Cloud (Hong Kong) | [registry.cn-hongkong.aliyuncs.com](https://help.aliyun.com/zh/acr/user-guide/accelerate-the-pulls-of-docker-official-images "https://registry.cn-hongkong.aliyuncs.com") | Google Cloud(Europe) | [eu.gcr.io](https://cloud.google.com/artifact-registry/docs/transition/gcr-repositories?hl=zh-cn "https://eu.gcr.io") | | Tencent Cloud | [mirror.ccs.tencentyun.com](https://cloud.tencent.com/document/product/1207/45596 "https://mirror.ccs.tencentyun.com") | Docker Hub | [registry.hub.docker.com](https://hub.docker.com/ "registry.hub.docker.com") | -
註:中國大陸雲端運算企業的鏡像倉庫來源僅針對其業務,中國大陸境內實例可能仍無法造訪 Docker Hub
+
註:中國大陸雲端運算企業的鏡像倉庫軟體源僅針對其業務,中國大陸境內實例可能仍無法造訪 Docker Hub
@@ -201,7 +201,7 @@ hide: | 名稱 | 意義 | 選項值 | | :-: | :-: | :-: | - | `--source` | 指定 `Docker CE` 來源位址(網域名稱或IP) | `位址` | + | `--source` | 指定 `Docker CE` 軟體源位址(網域名稱或IP) | `位址` | | `--source-registry` | 指定鏡像倉庫位址(網域名稱或IP) | `位址` | | `--branch` | 指定 Docker CE 源倉庫 | `倉庫名稱(詳見下方文檔)` | | `--codename` | 指定 Debian 係作業系統的版本代號 | `代號名稱` | @@ -217,13 +217,6 @@ hide: > 軟體源完整格式 `://<軟體源位址(網域名稱或IP)>/<軟體源倉庫(路徑)>` - - #### 指定 `Docker CE` 軟體源位址 - - ``` { .bash .no-copy } - bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source mirror.example.com/docker-ce - ``` - > 注意該位址路徑需要包含映像站的 Docker CE 軟體源倉庫路徑即 `docker-ce` - - #### 指定鏡像倉庫位址 ``` { .bash .no-copy } @@ -285,6 +278,13 @@ hide: [[ $(systemctl is-active docker) == "active" ]] && systemctl restart docker || systemctl enable --now docker ``` + - #### 指定 `Docker CE` 軟體源位址 + + ``` { .bash .no-copy } + bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source mirror.example.com/docker-ce + ``` + > 注意該位址路徑需要包含映像站的 Docker CE 軟體源倉庫路徑即 `docker-ce` + - #### 指定 Docker CE 軟體源倉庫 腳本預設會自動判斷一般無需指定,除非你有特殊需求 @@ -322,7 +322,7 @@ hide: > `Red Hat Enterprise Linux`   `CentOS`   `Rocky Linux`   `AlmaLinux`   `Fedora`   `openEuler`   `OpenCloudOS`   `Anolis OS` - 未出現在該清單中的版本則不支援透過本腳本安裝,如果取得不到版本清單說明你目前的系統環境還沒有正確配置 Docker CE 軟體來源(執行腳本時不存在該問題) + 未出現在該清單中的版本則不支援透過本腳本安裝,如果取得不到版本清單說明你目前的系統環境還沒有正確配置 Docker CE 軟體軟體源(執行腳本時不存在該問題) - #### 無人值守(自動化) diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 6a8c15f..78feef9 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -127,10 +127,6 @@ background-color: var(--navbar-background) !important; } -.tabbed-content .highlight { - padding-top: .4rem; -} - .md-banner { color: var(--md-default-fg-color--light); background-color: hsla(240, 9%, 75%, 0.53); diff --git a/docs/use/index.en.md b/docs/use/index.en.md index 4fce9b3..44140d2 100644 --- a/docs/use/index.en.md +++ b/docs/use/index.en.md @@ -505,7 +505,7 @@ Below are some advanced usage examples | **Raspberry Pi OS** | `raspberrypi` `raspbian` `debian` `debian-archive` | | **Red Hat Enterprise Linux** :material-information-outline:{ title="Version 9 uses CentOS Stream, 7/8 use CentOS" } | `centos` `centos-stream` `centos-altarch` `centos-vault` | | **Fedora** | `fedora` `fedora-archive` | - | **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | | **Rocky Linux** | `rocky` | | **AlmaLinux** | `almalinux` `almalinux-vault` | | **Oracle Linux** | `centos-stream` | @@ -593,21 +593,47 @@ Below are some advanced usage examples Usually for switching system versions. Example: - === "Upgrade GNU/Linux Debian to 12 Bookworm" + === "Upgrade GNU/Linux Debian to 13 "trixie"" - ``` bash - bash <(curl -sSL https://linuxmirrors.cn/main.sh) --codename bookworm - ``` + - Change version code + + ``` bash + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename trixie \ + --upgrade-software false + ``` + + - Disable the backports repository + + ``` bash + sed -i '/backports/s/^/# /' /etc/apt/sources.list + ``` + + - Upgrade the system + + ``` bash + apt-get update + apt-get dist-upgrade + ``` + + - After the upgrade is complete and the system is rebooted, perform the following steps + + ``` bash + # Clear the original software sources (back up any non-system software sources) + sed -i '1,$d' /etc/apt/sources.list + # Rerun the mirror switching script + bash <(curl -sSL https://linuxmirrors.cn/main.sh) + ``` === "Switch GNU/Linux Debian to testing branch" ``` bash - bash <(curl -sSL https://linuxmirrors.cn/main.sh) --codename testing + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename testing \ + --upgrade-software false ``` - After switching, run `apt-get dist-upgrade` and reboot, then rerun the script. Only changing the codename may cause compatibility issues later. - - ``` { .bash title="If the script can't set the codename, you can manually replace it after running" } + ``` { .bash .no-copy title="If the script can't set the codename, you can manually replace it after running" } sed -i "s/$(lsb_release -cs)/your-codename/g" /etc/apt/sources.list ``` diff --git a/docs/use/index.md b/docs/use/index.md index e013dd2..3033ec7 100644 --- a/docs/use/index.md +++ b/docs/use/index.md @@ -537,7 +537,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help | **Raspberry Pi OS** | `raspberrypi` `raspbian` `debian` `debian-archive` | | **Red Hat Enterprise Linux** :material-information-outline:{ title="9版本使用 CentOS Stream, 7、8版本使用CentOS" } | `centos` `centos-stream` `centos-altarch` `centos-vault` | | **Fedora** | `fedora` `fedora-archive` | - | **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | | **Rocky Linux** | `rocky` | | **AlmaLinux** | `almalinux` `almalinux-vault` | | **Oracle Linux** | `centos-stream` | @@ -576,7 +576,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help bash <(curl -sSL https://linuxmirrors.cn/main.sh) --only-epel ``` - 对于已经 EOL 的 EPEL 7 注意需要使用 [`archive`](https://dl.fedoraproject.org/pub/archive/epel) 仓库,境外以及海外网络环境建议通过命令选项 `--use-official-source-epel true` 使用官方源 + 对于已经 EOL 的 EPEL 7,注意需要使用 [`archive`](https://dl.fedoraproject.org/pub/archive/epel) 仓库,境外以及海外网络环境建议通过命令选项 `--use-official-source-epel true` 使用官方源 - ### 恢复使用官方源 @@ -625,21 +625,47 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help 大多数情况下自定义版本代号用于更换系统版本,请看下面的例子 - === "升级 GNU/Linux Debian 至 12 版本 Bookworm" + === "升级 GNU/Linux Debian 至 13 "trixie"" - ``` bash - bash <(curl -sSL https://linuxmirrors.cn/main.sh) --codename bookworm - ``` + - 更换版本代号 + + ``` bash + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename trixie \ + --upgrade-software false + ``` + + - 禁用 backports 仓库 + + ``` bash + sed -i '/backports/s/^/# /' /etc/apt/sources.list + ``` + + - 升级系统 + + ``` bash + apt-get update + apt-get dist-upgrade + ``` + + - 在升级完成并重新引导系统后执行以下步骤 + + ``` bash + # 清空原有软件源(如有非系统软件源内容请自行备份) + sed -i '1,$d' /etc/apt/sources.list + # 重新执行换源脚本 + bash <(curl -sSL https://linuxmirrors.cn/main.sh) + ``` === "将 GNU/Linux Debian 的版本切换到测试分支" ``` bash - bash <(curl -sSL https://linuxmirrors.cn/main.sh) --codename testing + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename testing \ + --upgrade-software false ``` - 更换软件源后还需要执行系统更新命令 `apt-get dist-upgrade`,并且建议在更新完成并重启系统后重新执行本换源脚本,因为仅更换软件源配置中的系统版本代号可能会在后期使用时产生一些兼容性问题 - - ``` { .bash title="若脚本无法实现指定版本代号,你也可以在执行脚本后手动替换" } + ``` { .bash .no-copy title="若脚本无法实现指定版本代号,你也可以在执行脚本后手动替换" } sed -i "s/$(lsb_release -cs)/指定版本代号/g" /etc/apt/sources.list ``` diff --git a/docs/use/index.zh-Hant.md b/docs/use/index.zh-Hant.md index 3837ca5..748ee42 100644 --- a/docs/use/index.zh-Hant.md +++ b/docs/use/index.zh-Hant.md @@ -507,7 +507,7 @@ hide: | **Raspberry Pi OS** | `raspberrypi` `raspbian` `debian` `debian-archive` | | **Red Hat Enterprise Linux** :material-information-outline:{ title="9版本使用 CentOS Stream, 7、8版本使用CentOS" } | `centos` `centos-stream` `centos-altarch` `centos-vault` | | **Fedora** | `fedora` `fedora-archive` | - | **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | | **Rocky Linux** | `rocky` | | **AlmaLinux** | `almalinux` `almalinux-vault` | | **Oracle Linux** | `centos-stream` | @@ -540,22 +540,22 @@ hide: !!! info "EPEL (Extra Packages for Enterprise Linux) 是由 Fedora 組織維護的一個附加軟體包倉庫,它主要適用於除 Fedora 作業系統以外的紅帽系 Linux 發行版,配置 EPEL 倉庫已成為廣大用戶的普遍需求,建議預設安裝它" - 有些時候你會發現想使用的鏡像站沒有 EPEL 倉庫,那麼你可以在第一次運行腳本時不安裝或更換 EPEL 來源,然後再單獨執行下面的命令 + 有些時候你會發現想使用的鏡像站沒有 EPEL 倉庫,那麼你可以在第一次運行腳本時不安裝或更換 EPEL 軟體源,然後再單獨執行下面的命令 ``` bash bash <(curl -sSL https://linuxmirrors.cn/main.sh) --only-epel ``` - 對於已經 EOL 的 EPEL 7 注意需要使用 [`archive`](https://dl.fedoraproject.org/pub/archive/epel) 倉庫,境外以及海外網絡環境建議通過命令選項 `--use-official-source-epel true` 使用官方源 + 對於已經 EOL 的 EPEL 7,注意需要使用 [`archive`](https://dl.fedoraproject.org/pub/archive/epel) 倉庫,境外以及海外網絡環境建議通過命令選項 `--use-official-source-epel true` 使用官方源 - ### 恢復使用官方源 - 當你不小心刪除了官方來源的備份時可以使用此命令來恢復,使用此命令選項後將跳過選擇軟體源步驟 + 當你不小心刪除了官方軟體源的備份時可以使用此命令來恢復,使用此命令選項後將跳過選擇軟體源步驟 ``` bash bash <(curl -sSL https://linuxmirrors.cn/main.sh) --use-official-source true ``` - > 部分系統不存在官方來源例如 `Arch Linux`,屆時會自動更換成相容性較高的阿里雲鏡像站 + > 部分系統不存在官方軟體源例如 `Arch Linux`,屆時會自動更換成相容性較高的阿里雲鏡像站 - ### 特定係統的使用範例 @@ -575,15 +575,15 @@ hide: --- - 建議使用 `騰訊雲` 或 `阿里雲` 鏡像站,或透過 `--use-official-source true` 命令選項使用官方來源 + 建議使用 `騰訊雲` 或 `阿里雲` 鏡像站,或透過 `--use-official-source true` 命令選項使用官方軟體源 另外 EPEL 7 也進入了 EOL,腳本同樣對其進行了適配 - - #### 指定 GNU/Linux Debian 作業系統的 Security 來源 + - #### 指定 GNU/Linux Debian 作業系統的 Security 軟體源 - 如果你想盡可能提高伺服器的安全性建議使用官方來源,因為鏡像同步存在延遲 + 如果你想盡可能提高伺服器的安全性建議使用官方軟體源,因為鏡像同步存在延遲 ``` bash bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ @@ -595,22 +595,48 @@ hide: 大多數情況下自訂版本代號用於更換系統版本,請看下面的例子 - === "升級 GNU/Linux Debian 至 12 版本 Bookworm" + === "升級 GNU/Linux Debian 至 13 "trixie"" - ``` bash - bash <(curl -sSL https://linuxmirrors.cn/main.sh) --codename bookworm - ``` + - 更換版本代號 + + ``` bash + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename trixie \ + --upgrade-software false + ``` + + - 停用 backports 倉庫 + + ``` bash + sed -i '/backports/s/^/# /' /etc/apt/sources.list + ``` + + - 升級系統 + + ``` bash + apt-get update + apt-get dist-upgrade + ``` + + - 升級完成並重新引導系統後執行下列步驟 + + ``` bash + # 清空原有軟體源(如有非系統軟體源內容請自行備份) + sed -i '1,$d' /etc/apt/sources.list + # 重新執行換源腳本 + bash <(curl -sSL https://linuxmirrors.cn/main.sh) + ``` === "將 GNU/Linux Debian 的版本切換到測試分支" ``` bash - bash <(curl -sSL https://linuxmirrors.cn/main.sh) --codename testing + bash <(curl -sSL https://linuxmirrors.cn/main.sh) \ + --codename testing \ + --upgrade-software false ``` - 更換軟體源後還需要執行系統更新命令 `apt-get dist-upgrade`,並且建議在更新完成並重新啟動系統後重新執行本換源腳本,因為僅更換軟體源配置中的系統版本代號可能會在後期使用時產生一些相容性問題 - - ``` { .bash title="如果腳本無法實現指定版本代號,你也可以在執行腳本後手動替換" } - sed -i "s/$(lsb_release -cs)/指定版本代号/g" /etc/apt/sources.list + ``` { .bash .no-copy title="如果腳本無法實現指定版本代號,你也可以在執行腳本後手動替換" } + sed -i "s/$(lsb_release -cs)/指定版本代號/g" /etc/apt/sources.list ``` - #### 更換 Ubuntu EOL版本軟體源