mirror of
https://gitee.com/SuperManito/LinuxMirrors
synced 2025-11-02 07:20:28 +08:00
更正文档
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<img src="/docs/assets/images/brand/light/3.png" alt="LinuxMirrors" width="140">
|
||||
</picture>
|
||||
<h1>LinuxMirrors</h1>
|
||||
<p>GNU/Linux system software mirror replacement script and Docker installation & mirror replacement script</p>
|
||||
<p>GNU/Linux mirror switching script & docker installation and registry mirror switching script</p>
|
||||
<p><a href="README.md">简体中文</a> | <a href="README.zh-Hant.md">繁體中文</a> | English</p>
|
||||
<p>
|
||||
<a href="https://github.com/SuperManito/LinuxMirrors/blob/main/LICENSE"><img src="https://shields.io/github/license/SuperManito/LinuxMirrors?color=%23007bff" alt="License: MIT"></a>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
comments: true
|
||||
comments_description: 請確保討論內容與項目的相關性,不得發布廣告等違規內容
|
||||
comments_description: 請確保討論內容與專案的相關性,不得發布廣告等違規內容
|
||||
hide:
|
||||
- navigation
|
||||
- toc
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: One-Click Script Makes Mirror Switching Easier
|
||||
description: GNU/Linux system software mirror replacement script and Docker installation & mirror replacement script
|
||||
description: GNU/Linux mirror switching script & docker installation and registry mirror switching script
|
||||
comments: true
|
||||
glightbox: false
|
||||
comments_description: This comment section is only for sharing project usage reviews and experiences. For issues or suggestions, please go to the <a href="/community">Community</a> or <a href="https://github.com/SuperManito/LinuxMirrors/issues" target="_blank">Issues</a>
|
||||
@@ -18,7 +18,7 @@ hide:
|
||||
</div>
|
||||
<img src="/assets/images/brand/light/2.png#only-light" alt="LinuxMirrors" style="width: 300px" />
|
||||
<img src="/assets/images/brand/dark/2.png#only-dark" alt="LinuxMirrors" style="width: 300px" />
|
||||
<figcaption>GNU/Linux system software mirror replacement script and Docker installation & mirror replacement script</figcaption>
|
||||
<figcaption>GNU/Linux mirror switching script & docker installation and registry mirror switching script</figcaption>
|
||||
<figcaption>One-Click Script Makes Mirror Switching Easier</figcaption>
|
||||
</figure>
|
||||
<figure class="home-cmd no-select" style="margin: 0; display: flex; flex-direction: column; justify-content: center" markdown>
|
||||
|
||||
@@ -3,7 +3,7 @@ title: 一鍵腳本讓換源更簡單
|
||||
description: GNU/Linux 更換系統軟體源腳本及 Docker 安裝與換源腳本
|
||||
comments: true
|
||||
glightbox: false
|
||||
comments_description: 此評論區僅用於展示項目使用評估和經驗分享,回饋問題或建議請前往<a href="/community">社群</a>或<a href="https://github.com/SuperManito/LinuxMirrors/issues" target="_blank">Issues</a>
|
||||
comments_description: 此評論區僅用於展示專案使用評估和經驗分享,回饋問題或建議請前往<a href="/community">社群</a>或<a href="https://github.com/SuperManito/LinuxMirrors/issues" target="_blank">Issues</a>
|
||||
hide:
|
||||
- navigation
|
||||
- toc
|
||||
@@ -48,7 +48,7 @@ hide:
|
||||
---
|
||||
|
||||
只需要一行指令就能直接運行,零技術門檻,無需安裝任何依賴
|
||||
文檔整合了 AI 搜尋與聊天,提供各種使用場景的解決方案
|
||||
文件整合了 AI 搜尋與聊天,提供各種使用場景的解決方案
|
||||
|
||||
- :material-vector-polyline:{ .lg .middle } __系統支援廣泛__
|
||||
|
||||
@@ -69,14 +69,14 @@ hide:
|
||||
---
|
||||
|
||||
最快僅需 10 秒即可完成軟體源的更換,高效能維運,節省大量時間成本
|
||||
項目經過數年的迭代與最佳化,腳本效能卓越運作穩定,場景判斷完善
|
||||
專案經過數年的迭代與最佳化,腳本效能卓越運作穩定,場景判斷完善
|
||||
|
||||
- :octicons-globe-24:{ .lg .middle } __全球網絡,執行無憂__
|
||||
|
||||
---
|
||||
|
||||
本網站提供全球邊緣網路加速,不畏各種網路環境,輕鬆訪問
|
||||
同時提供了多個備用地址以確保項目腳本始終可用,並真正做到使用無憂
|
||||
同時提供了多個備用地址以確保專案腳本始終可用,並真正做到使用無憂
|
||||
|
||||
- :material-arm-flex-outline:{ .lg .middle } __功能強大,無與倫比__
|
||||
|
||||
@@ -96,8 +96,8 @@ hide:
|
||||
|
||||
---
|
||||
|
||||
項目已設立 MIT 開源授權協議,腳本程式碼完全開源且免費使用
|
||||
請尊重作者的知識成果,傳播時請在顯著位置標註軟體源或項目地址
|
||||
專案已設立 MIT 開源授權協定,腳本程式碼完全開源且免費使用
|
||||
請尊重作者的知識成果,傳播時請在顯著位置標註軟體源或專案地址
|
||||
|
||||
</div>
|
||||
|
||||
@@ -106,7 +106,7 @@ hide:
|
||||
| 作業系統 | 適配版本 |
|
||||
| --- | :---: |
|
||||
| <a href="https://www.debian.org" title="https://www.debian.org" target="_blank"><img src="/assets/images/icon/debian.svg" width="16" height="16" style="vertical-align: -0.35em"></a> **Debian** | _8~13_ |
|
||||
| <a href="https://ubuntu.com" title="https://ubuntu.com" target="_blank"><img src="/assets/images/icon/ubuntu.svg" width="16" height="16" style="vertical-align: -0.15em"></a> **Ubuntu** :material-information-outline:{ title="支援烏班圖家族衍生作業系統,例如 <code>優麒麟</code> <code>Kubuntu</code> 等<br/>由於迭代速度較快並不直接支援所有非 LTS 的版本,因此具體詳見文檔" } | _14~25_ |
|
||||
| <a href="https://ubuntu.com" title="https://ubuntu.com" target="_blank"><img src="/assets/images/icon/ubuntu.svg" width="16" height="16" style="vertical-align: -0.15em"></a> **Ubuntu** :material-information-outline:{ title="支援烏班圖家族衍生作業系統,例如 <code>優麒麟</code> <code>Kubuntu</code> 等<br/>由於迭代速度較快並不直接支援所有非 LTS 的版本,因此具體詳見文件" } | _14~25_ |
|
||||
| <a href="https://www.kali.org" title="https://www.kali.org" target="_blank"><img src="/assets/images/icon/kali-linux.svg" width="16" height="16"></a> **Kali Linux** | _all_ |
|
||||
| <a href="https://linuxmint.com" title="https://linuxmint.com" target="_blank"><img src="/assets/images/icon/linux-mint.ico" width="16" height="16" style="vertical-align: -0.2em"></a> **Linux Mint** | _19~22 / LMDE 6_ |
|
||||
| <a href="https://www.deepin.org" title="https://www.deepin.org" target="_blank"><img src="/assets/images/icon/deepin.png" width="16" height="16" style="vertical-align: -0.2em"></a> **Deepin** | _all_ |
|
||||
|
||||
@@ -10,7 +10,7 @@ search:
|
||||
|
||||
???+ question "友情提示"
|
||||
|
||||
本項目預設提供的軟體源列表主要服務位於中國大陸的用戶,因此對你來說該頁面上可能存在許多無用的資訊。作者沒有精力去採集和維護全世界的可用軟體源,因此可能需要透過命令選項自定義使用才能滿足你的實際需求,具體預設的國際軟體源詳見下方。
|
||||
本專案預設提供的軟體源列表主要服務位於中國大陸的用戶,因此對你來說該頁面上可能存在許多無用的資訊。作者沒有精力去採集和維護全世界的可用軟體源,因此可能需要透過命令選項自定義使用才能滿足你的實際需求,具體預設的國際軟體源詳見下方。
|
||||
|
||||
## 中國大陸 :flag-CN:
|
||||
|
||||
|
||||
@@ -4,13 +4,7 @@ hide:
|
||||
- footer
|
||||
---
|
||||
|
||||
# :simple-docker:{style="color: #1d63ed"} Docker Installation & Mirror Switching Script
|
||||
|
||||
???+ question "Why do you see this notice?"
|
||||
|
||||
The script of this project currently mainly serves Simplified Chinese users, but from the very beginning it was defined as a universal mirror switching script, providing many command options for customization, which is also one of the reasons why this project is now available to users of other languages. The script output is currently fixed in Simplified Chinese. With feedback and usage from users of other languages, the script may support Traditional Chinese and English in the future.
|
||||
|
||||
The documentation is translated with tools, and some professional terms below may be inaccurate. Corrections are welcome.
|
||||
# :simple-docker:{style="color: #1d63ed"} Docker Installation & Registry Mirror Switcher
|
||||
|
||||
## One-Click Command
|
||||
|
||||
@@ -213,6 +207,29 @@ hide:
|
||||
|
||||
## Command Options (Advanced Usage)
|
||||
|
||||
<!-- termynal -->
|
||||
```
|
||||
$ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
|
||||
|
||||
Command options(name/meaning/value):
|
||||
|
||||
--source Specify Docker CE source address (domain or IP) address
|
||||
--source-registry Specify Docker registry mirror address (domain or IP) address
|
||||
--branch Specify Docker CE source repository (path) repo name
|
||||
--branch-version Specify Docker CE source repository version version
|
||||
--designated-version Specify Docker Engine installation version version
|
||||
--codename Specify Debian-based OS codename codename
|
||||
--protocol Specify Web protocol for Docker CE source http or https
|
||||
--use-intranet-source Prefer intranet Docker CE source address true or false
|
||||
--install-latest Whether to install the latest Docker Engine true or false
|
||||
--close-firewall Whether to disable the firewall true or false
|
||||
--clean-screen Whether to clear the screen before running true or false
|
||||
--only-registry Only switch registry mirror mode none
|
||||
--ignore-backup-tips Ignore backup overwrite prompt (do not backup) none
|
||||
--pure-mode Pure mode, minimal output none
|
||||
--help Show help menu none
|
||||
```
|
||||
|
||||
| Name | Meaning | Value |
|
||||
| :-: | :-: | :-: |
|
||||
| `--source` | Specify `Docker CE` source address (domain or IP) | `address` |
|
||||
@@ -221,7 +238,7 @@ hide:
|
||||
| `--branch-version` | Specify `Docker CE` source repository version | `version (see docs below)` |
|
||||
| `--designated-version` | Specify `Docker Engine` installation version | `version (see docs below)` |
|
||||
| `--codename` | Specify `Debian-based` OS codename | `codename` |
|
||||
| `--protocol` | Specify WEB protocol for `Docker CE` source | `http` or `https` |
|
||||
| `--protocol` | Specify Web protocol for `Docker CE` source | `http` or `https` |
|
||||
| `--use-intranet-source` | Prefer intranet `Docker CE` source address | `true` or `false` |
|
||||
| `--install-latest` | Whether to install the latest `Docker Engine` | `true` or `false` |
|
||||
| `--close-firewall` | Whether to disable the firewall | `true` or `false` |
|
||||
@@ -229,8 +246,9 @@ hide:
|
||||
| `--only-registry` | Only switch registry mirror mode | none |
|
||||
| `--ignore-backup-tips` | Ignore backup overwrite prompt (do not backup) | none |
|
||||
| `--pure-mode` | Pure mode, minimal output | none |
|
||||
| `--help` | Show help menu | none |
|
||||
|
||||
> Full source format: `<WEB protocol>://<source address (domain or IP)>/<repository path>`
|
||||
> Full source format: `< Web protocol>://<source address (domain or IP)>/<repository path>`
|
||||
|
||||
- ### Specify Registry Mirror Address
|
||||
|
||||
@@ -405,7 +423,7 @@ hide:
|
||||
|
||||
If it prompts that it is not supported, please use the system's own package management tool to install it. Because these packages are built and maintained by the Linux distribution's package maintainers and may have differences in configuration or are built from modified source code.
|
||||
|
||||
You can also use [{ width="140" style="vertical-align: -0.2rem" }](https://www.docker.com/products/docker-desktop)
|
||||
You can also use [{ width="140" style="vertical-align: -0.2rem" }](https://www.docker.com/products/docker-desktop)
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ hide:
|
||||
|
||||
由于一些不可抗力的因素,国内网络环境下目前无法访问 [Docker Hub](https://hub.docker.com) 因此不能正常拉取镜像,建议使用下方提到的国内可用镜像仓库源
|
||||
|
||||
注:脚本内的指定 WEB 协议交互仅用于控制 `Docker CE` 软件源,`Docker Registry` 强制使用 `HTTPS` 协议
|
||||
注:脚本内的指定 Web 协议交互仅用于控制 `Docker CE` 软件源,`Docker Registry` 强制使用 `HTTPS` 协议
|
||||
|
||||
|
||||
!!! quote "内置的镜像仓库源"
|
||||
@@ -219,14 +219,15 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
|
||||
--branch-version 指定 Docker CE 软件源仓库版本 版本号
|
||||
--designated-version 指定 Docker Engine 安装版本 版本号
|
||||
--codename 指定 Debian 系操作系统的版本代号 代号名称
|
||||
--protocol 指定 Docker CE 软件源的 WEB 协议 http 或 https
|
||||
--protocol 指定 Docker CE 软件源的 Web 协议 http 或 https
|
||||
--use-intranet-source 是否优先使用内网 Docker CE 软件源地址 true 或 false
|
||||
--install-latest 是否安装最新版本的 Docker Engine true 或 false
|
||||
--close-firewall 是否关闭防火墙 true 或 false
|
||||
--clean-screen 是否在运行前清除屏幕上的所有内容 true 或 false
|
||||
--only-registry 仅更换镜像仓库模式 无
|
||||
--ignore-backup-tips 忽略覆盖备份提示 无
|
||||
--ignore-backup-tips 忽略覆盖备份提示 无
|
||||
--pure-mode 纯净模式,精简打印内容 无
|
||||
--help 查看帮助菜单 无
|
||||
```
|
||||
|
||||
| 名称 | 含义 | 选项值 |
|
||||
@@ -237,7 +238,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
|
||||
| `--branch-version` | 指定 `Docker CE` 软件源仓库版本 | `版本号(详见下方文档)` |
|
||||
| `--designated-version` | 指定 `Docker Engine` 安装版本 | `版本号(详见下方文档)` |
|
||||
| `--codename` | 指定 `Debian` 系操作系统的版本代号 | `代号名称` |
|
||||
| `--protocol` | 指定 `Docker CE` 源的 WEB 协议 | `http` 或 `https` |
|
||||
| `--protocol` | 指定 `Docker CE` 源的 Web 协议 | `http` 或 `https` |
|
||||
| `--use-intranet-source` | 是否优先使用内网 `Docker CE` 软件源地址 | `true` 或 `false` |
|
||||
| `--install-latest` | 是否安装最新版本的 `Docker Engine` | `true` 或 `false` |
|
||||
| `--close-firewall` | 是否关闭防火墙 | `true` 或 `false` |
|
||||
@@ -245,6 +246,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
|
||||
| `--only-registry` | 仅更换镜像仓库模式 | 无 |
|
||||
| `--ignore-backup-tips` | 忽略覆盖备份提示(即不覆盖备份) | 无 |
|
||||
| `--pure-mode` | 纯净模式,精简打印内容 | 无 |
|
||||
| `--help` | 查看帮助菜单 | 无 |
|
||||
|
||||
> 软件源完整格式 `<WEB协议>://<软件源地址(域名或IP)>/<软件源仓库(路径)>`
|
||||
|
||||
@@ -421,7 +423,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
|
||||
|
||||
如果提示不支持那么请使用系统自带的包管理工具进行安装。因为这些软件包由 Linux 发行版的软件包维护者构建和维护,可能存在配置差异或由修改后的源代码构建。
|
||||
|
||||
也可以使用 [{ width="140" style="vertical-align: -0.2rem" }](https://www.docker.com/products/docker-desktop)
|
||||
也可以使用 [{ width="140" style="vertical-align: -0.2rem" }](https://www.docker.com/products/docker-desktop)
|
||||
|
||||
## 最佳实践
|
||||
|
||||
|
||||
@@ -6,12 +6,6 @@ hide:
|
||||
|
||||
# :simple-docker:{style="color: #1d63ed"} Docker 安裝與換源腳本
|
||||
|
||||
???+ question "為什麼會看到該提示?"
|
||||
|
||||
本項目腳本目前主要服務於簡體中文用戶,但是從立項之初就定義為了通用換源腳本,提供了諸多命令選項用於自定義使用,這也是本項目為什麼開始面向其它語言用戶使用的原因之一。腳本列印內容目前固定為簡體中文,隨著其它語言使用者的回饋和使用,腳本將來可能會支援繁體中文和英文。
|
||||
|
||||
文檔使用工具進行翻譯,下方內容中的專業術語可能存在不準確的情況,歡迎修正。
|
||||
|
||||
## 一鍵執行命令
|
||||
|
||||
=== "安裝"
|
||||
@@ -57,9 +51,9 @@ hide:
|
||||
```
|
||||
> 不建議在中國大陸網路環境下使用
|
||||
|
||||
整合安裝 [`Docker Engine`](https://docs.docker.com/engine) 和 [`Docker Compose`](https://docs.docker.com/compose),支援選擇或更換軟體源(Docker 軟體倉庫)以及鏡像倉庫、安裝指定版本、重裝等功能,支援 ARM 架構
|
||||
整合安裝 [`Docker Engine`](https://docs.docker.com/engine) 和 [`Docker Compose`](https://docs.docker.com/compose),支援選擇或更換軟體源(Docker 軟體倉庫)以及映像倉庫、安裝指定版本、重裝等功能,支援 ARM 架構
|
||||
|
||||
腳本參考[官方文檔](https://docs.docker.com/engine/install)使用系統套件管理工具進行安裝,不存在相容性、安全性等問題,可安裝的版本由 Docker CE 倉庫決定
|
||||
腳本參考[官方文件](https://docs.docker.com/engine/install)使用系統套件管理工具進行安裝,不存在相容性、安全性等問題,可安裝的版本由 Docker CE 倉庫決定
|
||||
|
||||
=== "僅更換鏡像加速器"
|
||||
|
||||
@@ -77,14 +71,14 @@ hide:
|
||||
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh) --only-registry
|
||||
```
|
||||
|
||||
=== ":simple-gitee: Gitee 碼雲 (鏡像倉庫)"
|
||||
=== ":simple-gitee: Gitee 碼雲 (映像倉庫)"
|
||||
|
||||
``` bash
|
||||
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --only-registry
|
||||
```
|
||||
> 即時同步、無延遲,中國大陸網路環境建議使用
|
||||
|
||||
=== ":simple-gitcode: GitCode (鏡像倉庫)"
|
||||
=== ":simple-gitcode: GitCode (映像倉庫)"
|
||||
|
||||
``` bash
|
||||
bash <(curl -sSL https://raw.gitcode.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --only-registry
|
||||
@@ -110,7 +104,7 @@ hide:
|
||||
|
||||
---
|
||||
|
||||
與 [get.docker.com](https://get.docker.com) 邏輯一致,融合了本項目換源架構以及特性
|
||||
與 [get.docker.com](https://get.docker.com) 邏輯一致,融合了本專案換源架構以及特性
|
||||
|
||||
- :material-graph:{ .lg .middle } __支援衍生作業系統__
|
||||
|
||||
@@ -162,20 +156,20 @@ hide:
|
||||
|
||||
Docker CE 全稱 Docker Community Edition(Docker 社群版),是 Docker Engine 的別稱,該倉庫用於下載並安裝 Docker 相關軟體包
|
||||
|
||||
- __Docker Registry 鏡像倉庫__
|
||||
- __Docker Registry 映像倉庫__
|
||||
|
||||
---
|
||||
|
||||
用於控制拉取鏡像的預設軟體源儲存倉庫,又稱為鏡像加速器,預設為官方容器鏡像倉庫 [Docker Hub](https://hub.docker.com)
|
||||
用於控制拉取鏡像的預設軟體源儲存倉庫,又稱為鏡像加速器,預設為官方容器映像倉庫 [Docker Hub](https://hub.docker.com)
|
||||
|
||||
</div>
|
||||
|
||||
由於一些不可抗力的因素,中國大陸網路環境下目前無法訪問 [Docker Hub](https://hub.docker.com) 因此無法正常拉取鏡像,建議使用下方提到的中國大陸可用鏡像倉庫軟體源
|
||||
由於一些不可抗力的因素,中國大陸網路環境下目前無法訪問 [Docker Hub](https://hub.docker.com) 因此無法正常拉取鏡像,建議使用下方提到的中國大陸可用映像倉庫源
|
||||
|
||||
註:腳本內的指定 WEB 協議互動僅用於控制 `Docker CE` 軟體源,`Docker Registry` 強制使用 `HTTPS` 協議
|
||||
註:腳本內的指定 Web 協定互動僅用於控制 `Docker CE` 軟體源,`Docker Registry` 強制使用 `HTTPS` 協定
|
||||
|
||||
|
||||
!!! quote "預設的鏡像倉庫源"
|
||||
!!! quote "預設的映像倉庫源"
|
||||
|
||||
<div style="text-align: center" markdown>
|
||||
<div style="font-size: 0.8rem"><strong>中國大陸可用</strong></div>
|
||||
@@ -187,7 +181,7 @@ hide:
|
||||
| DaoCloud | [docker.m.daocloud.io](https://docker.m.daocloud.io "docker.m.daocloud.io") | 老牌企業鏡像站,可用性高且速度快,現為白名單模式 |
|
||||
| 1Panel 鏡像 | [docker.1panel.live](https://1panel.cn "docker.1panel.live") | 企業產品自用鏡像 |
|
||||
|
||||
<blockquote style="border-left: none !important">本開源項目不適合採集個人自建的鏡像加速器,如有需要可搭配命令選項自行使用</blockquote>
|
||||
<blockquote style="border-left: none !important">本開源專案不適合採集個人自建的鏡像加速器,如有需要可搭配命令選項自行使用</blockquote>
|
||||
|
||||
<div style="font-size: 0.8rem; margin-top: 1rem"><strong>其它</strong></div>
|
||||
|
||||
@@ -207,38 +201,62 @@ 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") |
|
||||
|
||||
<blockquote style="border-left: none !important">註:中國大陸雲端運算企業的鏡像倉庫軟體源僅針對其業務,中國大陸境內實例可能仍無法造訪 Docker Hub</blockquote>
|
||||
<blockquote style="border-left: none !important">註:中國大陸雲端運算企業的映像倉庫軟體源僅針對其業務,中國大陸境內實例可能仍無法造訪 Docker Hub</blockquote>
|
||||
|
||||
</div>
|
||||
|
||||
## 命令選項(進階用法)
|
||||
|
||||
<!-- termynal -->
|
||||
```
|
||||
$ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
|
||||
命令選項(名稱/含義/值):
|
||||
|
||||
--source 指定 Docker CE 軟體源位址(網域名稱或IP) 位址
|
||||
--source-registry 指定 Docker 映像倉庫位址 (網域名稱或IP) 位址
|
||||
--branch 指定 Docker CE 軟體源倉庫 (路徑) 倉庫名稱
|
||||
--branch-version 指定 Docker CE 軟體源倉庫版本 版本號
|
||||
--designated-version 指定 Docker Engine 安裝版本 版本號
|
||||
--codename 指定 Debian 係作業系統的版本代號 代號名稱
|
||||
--protocol 指定 Docker CE 源的 Web 協定 http 或 https
|
||||
--use-intranet-source 是否優先使用內部網路 Docker CE 軟體源位址 true 或 false
|
||||
--install-latest 是否安裝最新版本的 Docker Engine true 或 false
|
||||
--close-firewall 是否關閉防火牆 true 或 false
|
||||
--clean-screen 是否在運行前清除螢幕上的所有內容 true 或 false
|
||||
--only-registry 僅更換映像倉庫模式 無
|
||||
--ignore-backup-tips 忽略覆蓋備份提示 無
|
||||
--pure-mode 純淨模式,精簡列印內容 無
|
||||
--help 查看幫助選單 無
|
||||
```
|
||||
|
||||
| 名稱 | 意義 | 選項值 |
|
||||
| :-: | :-: | :-: |
|
||||
| `--source` | 指定 `Docker CE` 軟體源位址(網域名稱或IP) | `位址` |
|
||||
| `--source-registry` | 指定 `Docker` 鏡像倉庫位址(網域名稱或IP) | `位址` |
|
||||
| `--branch` | 指定 `Docker CE` 軟體源倉庫(路徑) | `倉庫名稱(詳見下方文檔)` |
|
||||
| `--branch-version` | 指定 `Docker CE` 軟體源倉庫版本 | `版本號(詳見下方文檔)` |
|
||||
| `--designated-version` | 指定 `Docker Engine` 安裝版本 | `版本號(詳見下方文檔)` |
|
||||
| `--source-registry` | 指定 `Docker` 映像倉庫位址(網域名稱或IP) | `位址` |
|
||||
| `--branch` | 指定 `Docker CE` 軟體源倉庫(路徑) | `倉庫名稱(詳見下方文件)` |
|
||||
| `--branch-version` | 指定 `Docker CE` 軟體源倉庫版本 | `版本號(詳見下方文件)` |
|
||||
| `--designated-version` | 指定 `Docker Engine` 安裝版本 | `版本號(詳見下方文件)` |
|
||||
| `--codename` | 指定 `Debian` 係作業系統的版本代號 | `代號名稱` |
|
||||
| `--protocol` | 指定 `Docker CE` 源的 WEB 協議 | `http` 或 `https` |
|
||||
| `--protocol` | 指定 `Docker CE` 源的 Web 協定 | `http` 或 `https` |
|
||||
| `--use-intranet-source` | 是否優先使用內部網路 `Docker CE` 軟體源位址 | `true` 或 `false` |
|
||||
| `--install-latest` | 是否安裝最新版本的 `Docker Engine` | `true` 或 `false` |
|
||||
| `--close-firewall` | 是否關閉防火牆 | `true` 或 `false` |
|
||||
| `--clean-screen` | 是否在運行前清除螢幕上的所有內容 | `true` 或 `false` |
|
||||
| `--only-registry` | 僅更換鏡像倉庫模式 | 無 |
|
||||
| `--ignore-backup-tips` | 忽略覆蓋備份提示(即不覆蓋備份) |
|
||||
| `--only-registry` | 僅更換映像倉庫模式 | 無 |
|
||||
| `--ignore-backup-tips` | 忽略覆蓋備份提示(即不覆蓋備份) | 無 |
|
||||
| `--pure-mode` | 純淨模式,精簡列印內容 | 無 |
|
||||
| `--help` | 查看幫助選單 | 無 |
|
||||
|
||||
> 軟體源完整格式 `<WEB協議>://<軟體源位址(網域名稱或IP)>/<軟體源倉庫(路徑)>`
|
||||
> 軟體源完整格式 `<WEB協定>://<軟體源位址(網域名稱或IP)>/<軟體源倉庫(路徑)>`
|
||||
|
||||
- ### 指定鏡像倉庫位址
|
||||
- ### 指定映像倉庫位址
|
||||
|
||||
``` { .bash .no-copy }
|
||||
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source-registry registry.example.com
|
||||
```
|
||||
|
||||
- ### 僅更換鏡像倉庫
|
||||
- ### 僅更換映像倉庫
|
||||
|
||||
=== "使用腳本一鍵替換"
|
||||
|
||||
@@ -252,7 +270,7 @@ hide:
|
||||
|
||||
- 安裝 `jq` 軟體包
|
||||
|
||||
=== "Debian 係 / openKylin"
|
||||
=== "Debian 系 / openKylin"
|
||||
|
||||
``` bash
|
||||
apt-get install -y jq
|
||||
@@ -262,7 +280,7 @@ hide:
|
||||
|
||||
新裝系統需要先執行一次更新 `apt-get update`
|
||||
|
||||
=== "RedHat 係 / openEuler / OpenCloudOS / Anolis OS"
|
||||
=== "RedHat 系 / openEuler / OpenCloudOS / Anolis OS"
|
||||
|
||||
``` bash
|
||||
dnf install -y jq || yum install -y jq
|
||||
@@ -270,16 +288,16 @@ hide:
|
||||
|
||||
> `Red Hat Enterprise Linux` `CentOS` `Rocky Linux` `AlmaLinux` `Fedora` `openEuler` `OpenCloudOS` `Anolis OS`
|
||||
|
||||
- 指定鏡像倉庫位址
|
||||
- 指定映像倉庫位址
|
||||
|
||||
> 請手動替換 `<example.registry.com>` 為鏡像倉庫位址後在執行,詳見上方 “項目內置的鏡像倉庫源” 表格中的位址列
|
||||
> 請手動替換 `<example.registry.com>` 為映像倉庫位址後在執行,詳見上方 “專案內置的映像倉庫源” 表格中的位址列
|
||||
|
||||
``` bash
|
||||
SOURCE_REGISTRY='"https://<example.registry.com>"'
|
||||
```
|
||||
也可以指定多個鏡像倉庫,如 `SOURCE_REGISTRY='"https://example.registry.com","https://test.registry.com"'`,注意用英文逗號分割
|
||||
也可以指定多個映像倉庫,如 `SOURCE_REGISTRY='"https://example.registry.com","https://test.registry.com"'`,注意用英文逗號分割
|
||||
|
||||
- 替換鏡像倉庫位址
|
||||
- 替換映像倉庫位址
|
||||
|
||||
``` bash
|
||||
[ -s "/etc/docker/daemon.json" ] || echo "{}" >/etc/docker/daemon.json
|
||||
@@ -308,7 +326,7 @@ hide:
|
||||
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --branch centos
|
||||
```
|
||||
> 倉庫名稱是固定的,目前只有 `centos` `debian` `fedora` `raspbian` `rhel` `sles` `static` `ubuntu` 這幾個
|
||||
> 詳情請見 [官方安裝文檔](https://docs.docker.com/engine/install) 及 [Docker CE 官方倉庫](https://download.docker.com/linux)
|
||||
> 詳情請見 [官方安裝文件](https://docs.docker.com/engine/install) 及 [Docker CE 官方倉庫](https://download.docker.com/linux)
|
||||
|
||||
``` { .bash .no-copy title="还可以指定倉庫版本號" }
|
||||
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) \
|
||||
@@ -405,7 +423,7 @@ hide:
|
||||
|
||||
如果提示不支援那麼請使用系統自備的套件管理工具進行安裝。因為這些軟體包由 Linux 發行版的軟體包維護者建構和維護,可能存在配置差異或由修改後的原始碼建構。
|
||||
|
||||
也可以使用 [{ width="140" style="vertical-align: -0.2rem" }](https://www.docker.com/products/docker-desktop)
|
||||
也可以使用 [{ width="140" style="vertical-align: -0.2rem" }](https://www.docker.com/products/docker-desktop)
|
||||
|
||||
- ## 最佳實踐
|
||||
|
||||
@@ -420,4 +438,4 @@ hide:
|
||||
- #### 簡易方式
|
||||
|
||||
--8<-- "docs/other/example2.md"
|
||||
> 註:不指定 `Docker CE 源` 以及 `鏡像倉庫源` 則會交由使用者進行互動選擇,屆時會自動清屏 `$ clear`,從而導致你腳本的運行日誌被清除
|
||||
> 註:不指定 `Docker CE 源` 以及 `映像倉庫源` 則會交由使用者進行互動選擇,屆時會自動清屏 `$ clear`,從而導致你腳本的運行日誌被清除
|
||||
|
||||
@@ -99,5 +99,5 @@
|
||||
|
||||
[lang="zh-Hant"] .sponsor-text-1::after { content: "贊助商"; }
|
||||
[lang="zh-Hant"] .sponsor-text-2::after { content: "特別感謝"; }
|
||||
[lang="zh-Hant"] .sponsor-text-3::after { content: "本項目已加入 JetBrains & Netlify 開源項目計劃"; }
|
||||
[lang="zh-Hant"] .sponsor-text-3::after { content: "本專案已加入 JetBrains & Netlify 開源專案計劃"; }
|
||||
</style>
|
||||
|
||||
2
docs/theme/main.html
vendored
2
docs/theme/main.html
vendored
@@ -8,7 +8,7 @@
|
||||
|
||||
{% block announce %}
|
||||
<span style="font-size: .6rem !important;">{{
|
||||
'If you think this project is good and helpful to you, please click the Star in the upper right corner of the warehouse and share it with more friends.' if i18n_page_locale == 'en' else '如果您覺得這個項目不錯對您有幫助的話,請點擊倉庫右上角的 Star 並分享給更多的朋友' if i18n_page_locale == 'zh-Hant' else '如果觉得这个项目不错对您有所帮助的话,请点击仓库右上角的 Star 并分享给更多的朋友'
|
||||
'If you think this project is good and helpful to you, please click the Star in the upper right corner of the warehouse and share it with more friends.' if i18n_page_locale == 'en' else '如果您覺得這個專案不錯對您有幫助的話,請點擊倉庫右上角的 Star 並分享給更多的朋友' if i18n_page_locale == 'zh-Hant' else '如果觉得这个项目不错对您有所帮助的话,请点击仓库右上角的 Star 并分享给更多的朋友'
|
||||
}}</span>
|
||||
<span class="twemoji heart" style="font-size: .6rem;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 20.408c-.492.308-.903.546-1.192.709q-.23.129-.463.252h-.002a.75.75 0 0 1-.686 0 17 17 0 0 1-.465-.252 31 31 0 0 1-4.803-3.34C3.8 15.572 1 12.331 1 8.513 1 5.052 3.829 2.5 6.736 2.5 9.03 2.5 10.881 3.726 12 5.605 13.12 3.726 14.97 2.5 17.264 2.5 20.17 2.5 23 5.052 23 8.514c0 3.818-2.801 7.06-5.389 9.262A31 31 0 0 1 14 20.408"></path></svg></span>
|
||||
{% endblock %}
|
||||
|
||||
@@ -4,12 +4,6 @@ hide:
|
||||
- footer
|
||||
---
|
||||
|
||||
???+ question "Why do you see this notice?"
|
||||
|
||||
The script of this project currently mainly serves Simplified Chinese users, but from the very beginning it was defined as a universal mirror switching script, providing many command options for customization, which is also one of the reasons why this project is now available to users of other languages. The script output is currently fixed in Simplified Chinese. With feedback and usage from users of other languages, the script may support Traditional Chinese and English in the future.
|
||||
|
||||
The documentation is translated with tools, and some professional terms below may be inaccurate. Corrections are welcome.
|
||||
|
||||
## One-Click Command
|
||||
|
||||
=== ":material-home-city: Chinese mainland"
|
||||
@@ -440,6 +434,43 @@ hide:
|
||||
|
||||
## Command Options (Advanced Usage)
|
||||
|
||||
<!-- termynal -->
|
||||
```
|
||||
$ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
|
||||
Command options(name/meaning/value):
|
||||
|
||||
--abroad Use overseas mirrors none
|
||||
--edu Use China education network mirrors none
|
||||
--source Specify mirror address (domain or IP) address
|
||||
--source-epel Specify EPEL repository address (domain or IP) address
|
||||
--source-security Specify Debian/Ubuntu security repo address (domain or IP) address
|
||||
--source-vault Specify CentOS/AlmaLinux vault repo address (domain or IP) address
|
||||
--source-portage Specify Gentoo portage repo address (domain or IP) address
|
||||
--source-base-system Specify Linux Mint/Raspberry Pi OS base system repo address (domain or IP) address
|
||||
--branch Specify mirror repository (repo name) repo name
|
||||
--branch-epel Specify EPEL repository (path) repo name
|
||||
--branch-security Specify Debian security repo (path) repo name
|
||||
--branch-vault Specify CentOS/AlmaLinux vault repo (path) repo name
|
||||
--branch-portage Specify Gentoo portage repo (path) repo name
|
||||
--branch-base-system Specify Linux Mint/Raspberry Pi OS base system repo (path) repo name
|
||||
--codename Specify Debian/openKylin codename codename
|
||||
--protocol Specify web protocol http or https
|
||||
--use-intranet-source Prefer intranet mirror address true or false
|
||||
--use-official-source Use official mirror of target OS true or false
|
||||
--use-official-source-epel Use official EPEL repo true or false
|
||||
--install-epel Install EPEL repository true or false
|
||||
--backup Backup original mirrors true or false
|
||||
--upgrade-software Upgrade packages true or false
|
||||
--clean-cache Clean cache after upgrade true or false
|
||||
--clean-screen Clear screen before running true or false
|
||||
--only-epel Only switch EPEL repo none
|
||||
--ignore-backup-tips Ignore backup overwrite prompt none
|
||||
--print-diff Print diff before and after modification none
|
||||
--pure-mode Pure mode, minimal output none
|
||||
--help Show help menu none
|
||||
```
|
||||
|
||||
| Name | Meaning | Value |
|
||||
| - | - | :-: |
|
||||
| `--abroad` | Use overseas mirrors | none |
|
||||
@@ -466,9 +497,9 @@ hide:
|
||||
| `--upgrade-software` | Upgrade packages | `true` or `false` |
|
||||
| `--clean-cache` | Clean cache after upgrade | `true` or `false` |
|
||||
| `--clean-screen` | Clear screen before running | `true` or `false` |
|
||||
| `--print-diff` | Print diff before and after modification | `true` or `false` |
|
||||
| `--only-epel` | Only switch EPEL repo | none |
|
||||
| `--ignore-backup-tips` | Ignore backup overwrite prompt | none |
|
||||
| `--print-diff` | Print diff before and after modification | none |
|
||||
| `--pure-mode` | Pure mode, minimal output | none |
|
||||
| `--help` | Show help menu | none |
|
||||
|
||||
@@ -719,7 +750,7 @@ If you are a developer of another project and want to create a custom script bas
|
||||
| `USE_INTRANET_SOURCE` | Prefer intranet mirror address | `true` or `false` |
|
||||
| `USE_OFFICIAL_SOURCE` | Use official mirror of target OS | `true` or `false` |
|
||||
| `USE_OFFICIAL_SOURCE_EPEL` | Use official EPEL repo | `true` or `false` |
|
||||
| `WEB_PROTOCOL` | Specify WEB protocol | `http` or `https` |
|
||||
| `WEB_PROTOCOL` | Specify Web protocol | `http` or `https` |
|
||||
| `INSTALL_EPEL` | Install EPEL repository | `true` or `false` |
|
||||
| `ONLY_EPEL` | Only switch EPEL repo | `true` or `false` |
|
||||
| `BACKUP` | Backup original mirrors | `true` or `false` |
|
||||
|
||||
@@ -457,7 +457,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
--branch-portage 指定 Gentoo 系统 portage 仓库的软件源仓库(路径) 仓库名
|
||||
--branch-base-system 指定 Linux Mint / Raspberry Pi OS 底层系统的软件源仓库(路径) 仓库名
|
||||
--codename 指定 Debian 系 / openKylin 操作系统的版本代号 代号名称
|
||||
--protocol 指定 WEB 协议 http 或 https
|
||||
--protocol 指定 Web 协议 http 或 https
|
||||
--use-intranet-source 是否优先使用内网软件源地址 true 或 false
|
||||
--use-official-source 是否使用目标操作系统的官方软件源 true 或 false
|
||||
--use-official-source-epel 是否使用 EPEL 附加软件包的官方软件源 true 或 false
|
||||
@@ -468,8 +468,9 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
--clean-screen 是否在运行前清除屏幕上的所有内容 true 或 false
|
||||
--only-epel 仅更换 EPEL 软件源模式 无
|
||||
--ignore-backup-tips 忽略覆盖备份提示 无
|
||||
--print-diff 打印源文件修改前后差异 无
|
||||
--pure-mode 纯净模式,精简打印内容 无
|
||||
--print-diff 打印源文件修改前后差异 无
|
||||
--pure-mode 纯净模式,精简打印内容 无
|
||||
--help 查看帮助菜单 无
|
||||
```
|
||||
|
||||
| 名称 | 含义 | 选项值 |
|
||||
@@ -489,7 +490,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
| `--branch-portage` | 指定 Gentoo 系统 portage 仓库的软件源仓库(路径) | `仓库名` |
|
||||
| `--branch-base-system` | 指定 Linux Mint / Raspberry Pi OS 底层系统的软件源仓库(路径) | `仓库名` |
|
||||
| `--codename` | 指定 Debian 系 / openKylin 操作系统的版本代号 | `代号名称` |
|
||||
| `--protocol` | 指定 WEB 协议 | `http` 或 `https` |
|
||||
| `--protocol` | 指定 Web 协议 | `http` 或 `https` |
|
||||
| `--use-intranet-source` | 是否优先使用内网软件源地址 | `true` 或 `false` |
|
||||
| `--use-official-source` | 是否使用目标操作系统的官方软件源 | `true` 或 `false` |
|
||||
| `--use-official-source-epel` | 是否使用 EPEL 附加软件包的官方软件源 | `true` 或 `false` |
|
||||
@@ -498,9 +499,9 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
| `--upgrade-software` | 是否更新软件包 | `true` 或 `false` |
|
||||
| `--clean-cache` | 是否在更新软件包后清理下载缓存 | `true` 或 `false` |
|
||||
| `--clean-screen` | 是否在运行前清除屏幕上的所有内容 | `true` 或 `false` |
|
||||
| `--print-diff` | 是否打印源文件修改前后差异 | `true` 或 `false` |
|
||||
| `--only-epel` | 仅更换 EPEL 软件源模式 | 无 |
|
||||
| `--ignore-backup-tips` | 忽略覆盖备份提示(即不覆盖备份) | 无 |
|
||||
| `--print-diff` | 是否打印源文件修改前后差异 | 无 |
|
||||
| `--pure-mode` | 纯净模式,精简打印内容 | 无 |
|
||||
| `--help` | 查看帮助菜单 | 无 |
|
||||
|
||||
@@ -751,7 +752,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
| `USE_INTRANET_SOURCE` | 是否优先使用内网软件源地址 | `true` 或 `false` |
|
||||
| `USE_OFFICIAL_SOURCE` | 是否使用目标操作系统的官方软件源 | `true` 或 `false` |
|
||||
| `USE_OFFICIAL_SOURCE_EPEL` | 是否使用 EPEL 附加软件包的官方软件源 | `true` 或 `false` |
|
||||
| `WEB_PROTOCOL` | 指定 WEB 协议 | `http` 或 `https` |
|
||||
| `WEB_PROTOCOL` | 指定 Web 协议 | `http` 或 `https` |
|
||||
| `INSTALL_EPEL` | 是否安装 EPEL 附加软件包 | `true` 或 `false` |
|
||||
| `ONLY_EPEL` | 仅更换 EPEL 软件源模式 | `true` 或 `false` |
|
||||
| `BACKUP` | 是否备份原有软件源 | `true` 或 `false` |
|
||||
|
||||
@@ -4,12 +4,6 @@ hide:
|
||||
- footer
|
||||
---
|
||||
|
||||
???+ question "為什麼會看到該提示?"
|
||||
|
||||
本項目腳本目前主要服務於簡體中文用戶,但是從立項之初就定義為了通用換源腳本,提供了諸多命令選項用於自定義使用,這也是本項目為什麼開始面向其它語言用戶使用的原因之一。腳本列印內容目前固定為簡體中文,隨著其它語言使用者的回饋和使用,腳本將來可能會支援繁體中文和英文。
|
||||
|
||||
文檔使用工具進行翻譯,下方內容中的專業術語可能存在不準確的情況,歡迎修正。
|
||||
|
||||
## 一鍵執行命令
|
||||
|
||||
=== ":material-home-city: 中國大陸"
|
||||
@@ -148,14 +142,14 @@ hide:
|
||||
!!! tip "使用幫助"
|
||||
|
||||
選項卡分別代表腳本內建軟體源(鏡像站)類型和獲取腳本途徑,請在使用前檢查目標鏡像站是否支援你所使用的作業系統,可以在[軟體源列表](../mirrors/index.md)中查看。
|
||||
預設自動備份原有軟體源內容,如需了解更多請翻閱下方文檔。若使用過程中的某些選項令你疑惑不解,那麼在選擇軟體源後一路回車即是最佳實踐。
|
||||
預設自動備份原有軟體源內容,如需了解更多請翻閱下方文件。若使用過程中的某些選項令你疑惑不解,那麼在選擇軟體源後一路回車即是最佳實踐。
|
||||
|
||||
_支援在系統原有軟體源損壞、缺失、無效等異常環境下使用,無需額外安裝任何依賴。_
|
||||
|
||||
!!! quote "關於軟體源的選擇(新用戶必讀)"
|
||||
|
||||
如果你不了解這些鏡像站,那麼建議使用 `阿里雲 (相容性高、可用性強)` 或 `中國科學技術大學 (速度快)`,請不要陷入測速焦慮,內建的軟體源一般不會有太大的差異。
|
||||
本項目腳本是一個自動化維運工具,不會對鏡像站進行主觀的優劣排序和客製化適配,使用者的選擇應該是自由的,這也是為了開源軟體精神能夠得到更好的延續。
|
||||
本專案腳本是一個自動化維運工具,不會對鏡像站進行主觀的優劣排序和客製化適配,使用者的選擇應該是自由的,這也是為了開源軟體精神能夠得到更好的延續。
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
@@ -193,7 +187,7 @@ hide:
|
||||
|
||||
此報錯是由於系統沒有安裝 `curl` 軟體包導致,安裝命令如下
|
||||
|
||||
=== "Debian 係 / openKylin"
|
||||
=== "Debian 系 / openKylin"
|
||||
|
||||
``` bash
|
||||
apt-get install -y curl
|
||||
@@ -203,7 +197,7 @@ hide:
|
||||
|
||||
新裝系統需要先執行一遍更新 `apt-get update`
|
||||
|
||||
=== "RedHat 係 / openEuler / OpenCloudOS / Anolis OS"
|
||||
=== "RedHat 系 / openEuler / OpenCloudOS / Anolis OS"
|
||||
|
||||
``` bash
|
||||
dnf install -y curl || yum install -y curl
|
||||
@@ -295,7 +289,7 @@ hide:
|
||||
|
||||
!!! quote ""
|
||||
|
||||
=== "Debian 係 / openKylin"
|
||||
=== "Debian 系 / openKylin"
|
||||
|
||||
=== "傳統格式"
|
||||
|
||||
@@ -314,7 +308,7 @@ hide:
|
||||
|
||||
> `Debian` `Ubuntu` `Kali` `Linux Mint` `Deepin` `Zorin OS` `Armbian` `Proxmox VE` `Raspberry Pi OS` `openKylin`
|
||||
|
||||
=== "RedHat 係 / openEuler / OpenCloudOS / Anolis OS"
|
||||
=== "RedHat 系 / openEuler / OpenCloudOS / Anolis OS"
|
||||
|
||||
``` bash
|
||||
cp -rf /etc/yum.repos.d.bak /etc/yum.repos.d
|
||||
@@ -401,7 +395,7 @@ hide:
|
||||
|
||||
!!! quote ""
|
||||
|
||||
項目利用 [GitHub Action](https://github.com/SuperManito/LinuxMirrors/blob/main/.github/workflows/build-docs.yml#L29) 在每次提交後自動拷貝原始碼到文檔目錄作為網站資源發佈,網站託管於 [:netlify: Netlify](https://www.netlify.com),幾乎沒有使用風險。
|
||||
專案利用 [GitHub Action](https://github.com/SuperManito/LinuxMirrors/blob/main/.github/workflows/build-docs.yml#L29) 在每次提交後自動拷貝原始碼到文件目錄作為網站資源發佈,網站託管於 [:netlify: Netlify](https://www.netlify.com),幾乎沒有使用風險。
|
||||
|
||||
當然你也可以使用程式碼託管倉庫的原始位址來調用,這裡只是想告訴你為什麼會有幾個不同的位址,預設的官網位址更容易記憶和訪問。
|
||||
|
||||
@@ -413,7 +407,7 @@ hide:
|
||||
|
||||
軟體源(鏡像站)的網路延遲即 `Ping` 與下載速度沒有太大的關聯,雙方地理位置間隔的遠近不代表實際體驗,有些鏡像站下行總頻寬很高但實際測速卻並不理想,因為這與鏡像站的負載策略有關。
|
||||
|
||||
網路上也有很多基於 C、Python 編寫的鏡像站測速開源腳本,而本項目腳本基於 Bash Shell 編寫且不依賴任何第三方庫,Bash 是 Linux 運維中最常用的腳本語言並且絕大部分發行版都會預裝,這意味著用戶不需要安裝任何環境就能直接運行,這種便利性是其他高級語言無法替代的,不過目前 Bash 腳本可能不太容易實現精準測速的功能,使用其它高級語言編寫測速功能無疑是造輪子的行為。
|
||||
網路上也有很多基於 C、Python 編寫的鏡像站測速開源腳本,而本專案腳本基於 Bash Shell 編寫且不依賴任何第三方庫,Bash 是 Linux 運維中最常用的腳本語言並且絕大部分發行版都會預裝,這意味著用戶不需要安裝任何環境就能直接運行,這種便利性是其他高級語言無法替代的,不過目前 Bash 腳本可能不太容易實現精準測速的功能,使用其它高級語言編寫測速功能無疑是造輪子的行為。
|
||||
|
||||
- #### 關於未啟用的軟體源倉庫
|
||||
|
||||
@@ -421,13 +415,13 @@ hide:
|
||||
|
||||
許多系統的軟體源會啟用多個倉庫,腳本遵循系統預設設置,預設不啟用的軟體源(倉庫)不會在運行完本腳本後被啟用,但是它們也隨腳本更換了目標軟體源位址,具體啟用方法如下:
|
||||
|
||||
=== "Debian 係 / openKylin"
|
||||
=== "Debian 系 / openKylin"
|
||||
|
||||
預設禁用了`deb-src`原始碼倉庫和`proposed`預發佈軟體源,若需啟用請將 `/etc/apt/sources.list` 文件中相關內容的所在行取消註釋
|
||||
|
||||
> `Debian` `Ubuntu` `Kali` `Linux Mint` `Deepin` `Zorin OS` `Armbian` `Proxmox VE` `Raspberry Pi OS` `openKylin`
|
||||
|
||||
=== "RedHat 係 / openEuler / OpenCloudOS / Anolis OS"
|
||||
=== "RedHat 系 / openEuler / OpenCloudOS / Anolis OS"
|
||||
|
||||
部分倉庫預設沒有啟用,若需啟用請將 `/etc/yum.repos.d` 目錄下相關 repo 文件中的 `enabled` 值修改為 `1`
|
||||
|
||||
@@ -442,7 +436,44 @@ hide:
|
||||
|
||||
## 命令選項(進階用法)
|
||||
|
||||
| 名称 | 含义 | 选项值 |
|
||||
<!-- termynal -->
|
||||
```
|
||||
$ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
|
||||
|
||||
命令選項(名稱/含義/值):
|
||||
|
||||
--abroad 使用境外以及海外軟體源 無
|
||||
--edu 使用中國大陸教育網軟體源 無
|
||||
--source 指定軟體源地址(網域名稱或IP) 位址
|
||||
--source-epel 指定 EPEL 附加軟體包倉庫的軟體源地址(網域名稱或IP) 位址
|
||||
--source-security 指定 Debian / Ubuntu 系統 security 倉庫的軟體源地址(網域名稱或IP) 位址
|
||||
--source-vault 指定 CentOS / AlmaLinux 系統 vault 倉庫的軟體源地址(網域名稱或IP) 位址
|
||||
--source-portage 指定 Gentoo 系統 portage 倉庫的軟體源地址(網域名稱或IP) 位址
|
||||
--source-base-system 指定 Linux Mint / Raspberry Pi OS 底層系統的軟體源地址(網域名稱或IP) 位址
|
||||
--branch 指定軟體源倉庫(路徑) 倉庫名稱
|
||||
--branch-epel 指定 EPEL 附加軟體包倉庫的軟體源倉庫(路徑) 倉庫名稱
|
||||
--branch-security 指定 Debian 系統 security 倉庫的軟體源倉庫(路徑) 倉庫名稱
|
||||
--branch-vault 指定 CentOS / AlmaLinux 系統 vault 倉庫的軟體源倉庫(路徑) 倉庫名稱
|
||||
--branch-portage 指定 Gentoo 系統 portage 倉庫的軟體源倉庫(路徑) 倉庫名稱
|
||||
--branch-base-system 指定 Linux Mint / Raspberry Pi OS 底層系統的軟體源倉庫(路徑) 倉庫名稱
|
||||
--codename 指定 Debian 系 / openKylin 系統的版本代號 代號名稱
|
||||
--protocol 指定 Web 協定 http 或 https
|
||||
--use-intranet-source 是否優先使用內部網路軟體源位址 true 或 false
|
||||
--use-official-source 是否使用目標系統的官方軟體源 true 或 false
|
||||
--use-official-source-epel 是否使用 EPEL 附加軟體包的官方軟體源 true 或 false
|
||||
--install-epel 是否安裝 EPEL 附加軟體包 true 或 false
|
||||
--backup 是否備份原有軟體源 true 或 false
|
||||
--upgrade-software 是否更新軟體包 true 或 false
|
||||
--clean-cache 是否在更新軟體包後清理下載快取 true 或 false
|
||||
--clean-screen 是否在運行前清除螢幕上的所有內容 true 或 false
|
||||
--only-epel 僅更換 EPEL 軟體源模式 無
|
||||
--ignore-backup-tips 忽略覆蓋備份提示 無
|
||||
--print-diff 是否列印原始文件修改前後差異 無
|
||||
--pure-mode 純淨模式,精簡列印內容 無
|
||||
--help 查看幫助選單 無
|
||||
```
|
||||
|
||||
| 名稱 | 含義 | 选项值 |
|
||||
| - | - | :-: |
|
||||
| `--abroad` | 使用境外以及海外軟體源 | 無 |
|
||||
| `--edu` | 使用中國大陸教育網軟體源 | 無 |
|
||||
@@ -458,8 +489,8 @@ hide:
|
||||
| `--branch-vault` | 指定 CentOS / AlmaLinux 系統 vault 倉庫的軟體源倉庫(路徑) | `倉庫名稱` |
|
||||
| `--branch-portage` | 指定 Gentoo 系統 portage 倉庫的軟體源倉庫(路徑) | `倉庫名稱` |
|
||||
| `--branch-base-system` | 指定 Linux Mint / Raspberry Pi OS 底層系統的軟體源倉庫(路徑) | `倉庫名稱` |
|
||||
| `--codename` | 指定 Debian 係 / openKylin 作業系統的版本代號 | `代號名稱` |
|
||||
| `--protocol` | 指定 WEB 協議 | `http` 或 `https` |
|
||||
| `--codename` | 指定 Debian 系 / openKylin 作業系統的版本代號 | `代號名稱` |
|
||||
| `--protocol` | 指定 Web 協定 | `http` 或 `https` |
|
||||
| `--use-intranet-source` | 是否優先使用內部網路軟體源位址 | `true` 或 `false` |
|
||||
| `--use-official-source` | 是否使用目標作業系統的官方軟體源 | `true` 或 `false` |
|
||||
| `--use-official-source-epel` | 是否使用 EPEL 附加軟體包的官方軟體源 | `true` 或 `false` |
|
||||
@@ -468,13 +499,13 @@ hide:
|
||||
| `--upgrade-software` | 是否更新軟體套件 | `true` 或 `false` |
|
||||
| `--clean-cache` | 是否在更新軟體包後清理下載快取 | `true` 或 `false` |
|
||||
| `--clean-screen` | 是否在運行前清除螢幕上的所有內容 | `true` 或 `false` |
|
||||
| `--print-diff` | 是否列印原始文件修改前後差異 | `true` 或 `false` |
|
||||
| `--only-epel` | 僅更換 EPEL 軟體源模式 | 無 |
|
||||
| `--ignore-backup-tips` | 忽略覆蓋備份提示(即不覆蓋備份) | 無 |
|
||||
| `--print-diff` | 是否列印原始文件修改前後差異 | 無 |
|
||||
| `--pure-mode` | 純淨模式,精簡列印內容 | 無 |
|
||||
| `--help` | 查看幫助選單 | 無 |
|
||||
|
||||
> 軟體源完整格式 `<WEB協議>://<軟體源位址(網域名稱或IP)>/<軟體源倉庫(路徑)>`
|
||||
> 軟體源完整格式 `<WEB協定>://<軟體源位址(網域名稱或IP)>/<軟體源倉庫(路徑)>`
|
||||
|
||||
以下是一些進階用法的舉例
|
||||
|
||||
@@ -488,11 +519,11 @@ hide:
|
||||
|
||||
這裡描述的軟體源倉庫與系統軟體倉庫不同,指的是軟體源(鏡像站)位址後面的路徑即鏡像站的倉庫目錄,雖然名義上都是倉庫但是非常容易混淆
|
||||
|
||||
主要使用情境:目標鏡像站有對應的系統鏡像倉庫但是不符合本項目腳本關於軟體源倉庫設定的預設規則
|
||||
主要使用情境:目標鏡像站有對應的系統鏡像倉庫但是不符合本專案腳本關於軟體源倉庫設定的預設規則
|
||||
|
||||
??? note "項目對於各作業系統所使用的預設倉庫名稱(點選展開檢視)"
|
||||
??? note "專案對於各作業系統所使用的預設倉庫名稱(點選展開檢視)"
|
||||
|
||||
項目腳本為了適配大的環境不會針對某一鏡像站獨特的倉庫名稱而單獨適配
|
||||
專案腳本為了適配大的環境不會針對某一鏡像站獨特的倉庫名稱而單獨適配
|
||||
|
||||
| 系統名稱 | 涉及的名稱 |
|
||||
| --- | :---: |
|
||||
@@ -591,7 +622,7 @@ hide:
|
||||
--branch-security debian-security
|
||||
```
|
||||
|
||||
- #### 指定 Debian 係 Linux 作業系統的版本代號
|
||||
- #### 指定 Debian 系 Linux 作業系統的版本代號
|
||||
|
||||
大多數情況下自訂版本代號用於更換系統版本,請看下面的例子
|
||||
|
||||
@@ -653,7 +684,7 @@ hide:
|
||||
|
||||
- #### Arch Linux 使用中文社群倉庫
|
||||
|
||||
本項目腳本目前不支援此額外倉庫,因使用人數較少等原因暫不考慮適配,若想使用請參考下方的一鍵設定命令
|
||||
本專案腳本目前不支援此額外倉庫,因使用人數較少等原因暫不考慮適配,若想使用請參考下方的一鍵設定命令
|
||||
|
||||
``` bash
|
||||
SOURCE="https://mirrors.aliyun.com/archlinuxcn" # 指定軟體源位址
|
||||
@@ -691,9 +722,9 @@ hide:
|
||||
|
||||
## 客製化腳本
|
||||
|
||||
如果你是其它項目的開發者希望透過本項目來製作專屬腳本,那麼請參考下面提到的內容,目前已經有中國大陸教育單位鏡像站的維護者這樣做了。
|
||||
如果你是其它專案的開發者希望透過本專案來製作專屬腳本,那麼請參考下面提到的內容,目前已經有中國大陸教育單位鏡像站的維護者這樣做了。
|
||||
|
||||
1. 首先不建議修改程式碼的底層邏輯,應盡量與本項目原始碼保持同步,腳本內容執行順序由 `main` 函數控制,程式碼邏輯清晰
|
||||
1. 首先不建議修改程式碼的底層邏輯,應盡量與本專案原始碼保持同步,腳本內容執行順序由 `main` 函數控制,程式碼邏輯清晰
|
||||
2. 你可以簡單去除一些無關內容,例如將軟體源列表(陣列)`mirror_list_(default|edu|abroad|extranet|intranet)` 中的內容刪除,例如:`mirror_list_default=()`
|
||||
3. 如果你想要自定義腳本列印內容可直接修改 `run_start` `run_end` `print_title` 這三個函數中的內容
|
||||
4. 如果你想加入自定義 Shell 內容請參見 `main` 函數中腳本執行順序,可以在對應位置直接插入內容也可以封裝函數後調用
|
||||
|
||||
Reference in New Issue
Block a user