diff --git a/ChangeMirrors.sh b/ChangeMirrors.sh index 0acb7d6..70eb92e 100755 --- a/ChangeMirrors.sh +++ b/ChangeMirrors.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Author: SuperManito -## Modified: 2025-11-02 +## Modified: 2025-11-04 ## License: MIT ## GitHub: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn @@ -730,7 +730,11 @@ function command_exists() { function permission_judgment() { if [ $UID -ne 0 ]; then - output_error "$(msg "error.needRoot")" + local change_cmd="su root" + if command_exists sudo; then + change_cmd="sudo -i" + fi + output_error "$(msg "error.needRoot" "${BLUE}${change_cmd}${PLAIN}")" fi } @@ -747,7 +751,7 @@ function collect_system_info() { SYSTEM_PRETTY_NAME="$(get_os_release_value PRETTY_NAME)" ## 定义系统版本号 SYSTEM_VERSION_ID="$(get_os_release_value VERSION_ID)" - SYSTEM_VERSION_ID_MAJOR="${SYSTEM_VERSION_ID%.*}" + SYSTEM_VERSION_ID_MAJOR="${SYSTEM_VERSION_ID%%.*}" SYSTEM_VERSION_ID_MINOR="${SYSTEM_VERSION_ID#*.}" ## 定义系统ID SYSTEM_ID="$(get_os_release_value ID)" @@ -803,7 +807,7 @@ function collect_system_info() { ## 尚未正式发布的版本 if [[ -z "${SYSTEM_VERSION_ID}" && "${SYSTEM_VERSION_CODENAME}" == "trixie" ]]; then SYSTEM_VERSION_ID="13" - SYSTEM_VERSION_ID_MAJOR="${SYSTEM_VERSION_ID%.*}" + SYSTEM_VERSION_ID_MAJOR="${SYSTEM_VERSION_ID%%.*}" SYSTEM_VERSION_ID_MINOR="${SYSTEM_VERSION_ID#*.}" fi ## 是否使用 DEB822 格式 @@ -843,10 +847,8 @@ function collect_system_info() { local is_supported="true" case "${SYSTEM_JUDGMENT}" in "${SYSTEM_DEBIAN}") - if [[ "${SYSTEM_VERSION_ID_MAJOR}" =~ ^[0-9]{1,2}$ ]]; then - if [[ "${SYSTEM_VERSION_ID_MAJOR}" -lt 8 || "${SYSTEM_VERSION_ID_MAJOR}" -gt 13 ]]; then - is_supported="false" - fi + if [[ ! "${SYSTEM_VERSION_ID_MAJOR}" =~ ^(1[0-3]|[8-9])$ ]]; then + is_supported="false" fi if [[ "${SYSTEM_VERSION_CODENAME}" == "sid" ]]; then if [[ "${PURE_MODE}" != "true" ]]; then @@ -855,17 +857,23 @@ function collect_system_info() { fi ;; "${SYSTEM_UBUNTU}") - if [[ "${SYSTEM_VERSION_ID_MAJOR}" -lt 14 || "${SYSTEM_VERSION_ID_MAJOR}" -gt 25 ]]; then + if [[ ! "${SYSTEM_VERSION_ID_MAJOR}" =~ ^(1[4-9]|2[0-5])$ ]]; then is_supported="false" fi ;; "${SYSTEM_LINUX_MINT}") - if [[ "${SYSTEM_VERSION_ID_MAJOR}" != 19 && "${SYSTEM_VERSION_ID_MAJOR}" != 2[0-2] && "${SYSTEM_VERSION_ID_MAJOR}" != 6 ]]; then - is_supported="false" + if [[ "${SYSTEM_NAME}" == *"LMDE"* ]]; then + if [[ "${SYSTEM_VERSION_ID_MAJOR}" != [6-7] ]]; then + is_supported="false" + fi + else + if [[ ! "${SYSTEM_VERSION_ID_MAJOR}" =~ ^(19|2[0-2])$ ]]; then + is_supported="false" + fi fi ;; "${SYSTEM_RHEL}") - if [[ "${SYSTEM_VERSION_ID_MAJOR}" != [7-9] && "${SYSTEM_VERSION_ID_MAJOR}" != 10 ]]; then + if [[ ! "${SYSTEM_VERSION_ID_MAJOR}" =~ ^([7-9]|10)$ ]]; then is_supported="false" fi ;; @@ -875,7 +883,7 @@ function collect_system_info() { fi ;; "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_ORACLE}") - if [[ "${SYSTEM_VERSION_ID_MAJOR}" != [8-9] && "${SYSTEM_VERSION_ID_MAJOR}" != 10 ]]; then + if [[ ! "${SYSTEM_VERSION_ID_MAJOR}" =~ ^([8-9]|10)$ ]]; then is_supported="false" fi ;; @@ -890,12 +898,12 @@ function collect_system_info() { fi ;; "${SYSTEM_OPENCLOUDOS}") - if [[ "${SYSTEM_VERSION_ID_MAJOR}" != [8-9] && "${SYSTEM_VERSION_ID_MAJOR}" != 23 ]] || [[ "${SYSTEM_VERSION_ID_MAJOR}" == 8 && "${SYSTEM_VERSION_ID_MINOR}" -lt 6 ]]; then + if [[ ! "${SYSTEM_VERSION_ID_MAJOR}" =~ ^([8-9]|23)$ ]] || [[ "${SYSTEM_VERSION_ID_MAJOR}" == 8 && "${SYSTEM_VERSION_ID_MINOR}" -lt 6 ]]; then is_supported="false" fi ;; "${SYSTEM_ANOLISOS}") - if [[ "${SYSTEM_VERSION_ID_MAJOR}" != 8 && "${SYSTEM_VERSION_ID_MAJOR}" != 23 ]]; then + if [[ ! "${SYSTEM_VERSION_ID_MAJOR}" =~ ^(8|23)$ ]]; then is_supported="false" fi ;; @@ -2090,13 +2098,11 @@ Signed-By: /usr/share/keyrings/${SYSTEM_JUDGMENT,,}-archive-keyring.gpg" function gen_deb822() { echo "$(_template_deb822 "deb" "${1}" "${2}" "${3}") -${deb_src_disabled_tips} $(_template_deb822 "deb-src" "${1}" "${2}" "${3}" | sed -e "s|^|# |g")" } function gen_deb822_disabled() { echo "$(_template_deb822 "deb" "${1}" "${2}" "${3}" | sed -e "s|^|# |g") -${deb_src_disabled_tips} $(_template_deb822 "deb-src" "${1}" "${2}" "${3}" | sed -e "s|^|# |g")" } function gen_deb_security() { @@ -2125,10 +2131,12 @@ $(gen_deb "${1}" "${2}-updates" "${3}")" function gen_debian_deb822() { case "${2}" in forky | trixie | bookworm | stable | oldstable | testing) - echo "$(gen_deb822 "${1}" "${2} ${2}-updates ${2}-backports" "${3}")" + echo "${deb_src_disabled_tips} +$(gen_deb822 "${1}" "${2} ${2}-updates ${2}-backports" "${3}")" ;; *) - echo "$(gen_deb822 "${1}" "${2} ${2}-updates" "${3}")" + echo "${deb_src_disabled_tips} +$(gen_deb822 "${1}" "${2} ${2}-updates" "${3}")" ;; esac } @@ -2140,7 +2148,8 @@ $(gen_deb "${1}" "${2}-backports" "${3}") $(gen_deb_disabled "${1}" "${2}-proposed" "${3}")" } function gen_ubuntu_deb822() { - echo "$(gen_deb822 "${1}" "${2} ${2}-updates ${2}-backports" "${3}") + echo "${deb_src_disabled_tips} +$(gen_deb822 "${1}" "${2} ${2}-updates ${2}-backports" "${3}") ## $(msg "source.comment.proposedSource") $(gen_deb822_disabled "${1}" "${2}-proposed" "${3}")" @@ -6368,7 +6377,7 @@ EOF ## 生成 OpenCloudOS repo 源文件 function gen_repo_files_OpenCloudOS() { - case "${1%.*}" in + case "${1%%.*}" in 23) cat <<'EOF' >$Dir_YumRepos/OpenCloudOS-Stream.repo [BaseOS] @@ -6697,7 +6706,7 @@ EOF ## 生成 Anolis OS repo 源文件 function gen_repo_files_AnolisOS() { - case "${1%.*}" in + case "${1%%.*}" in 23) cat <<'EOF' >$Dir_YumRepos/AnolisOS.repo [os] @@ -6961,7 +6970,7 @@ EOF function gen_repo_files_openSUSE() { case "$1" in "leap") - case "${2%.*}" in + case "${2%%.*}" in 16) cat <<'EOF' >$Dir_ZYppRepos/openSUSE:repo-non-oss-debug.repo [openSUSE:repo-non-oss-debug] @@ -7761,7 +7770,7 @@ function msg_pack_zh_hans() { ['error.unknownSystem']='未知系统' ['error.unknownVersion']='系统版本未知' ['error.input']='输入错误,{}!' - ['error.needRoot']='权限不足,请使用 Root 用户运行本脚本' + ['error.needRoot']='权限不足,请切换至 root 账户后运行本脚本,切换命令 {}' ['error.defaultBehavior.https']='默认使用 HTTPS 协议' ['error.defaultBehavior.noReplace']='默认不更换' ['error.defaultBehavior.noOverwrite']='默认不覆盖' @@ -7993,7 +8002,7 @@ function msg_pack_zh_hant() { ['error.unknownSystem']='未知系統' ['error.unknownVersion']='系統版本未知' ['error.input']='輸入錯誤,{}!' - ['error.needRoot']='權限不足,請使用 Root 使用者執行本腳本' + ['error.needRoot']='權限不足,請切換至 root 帳戶後執行本腳本,切換指令 {}' ['error.defaultBehavior.https']='預設使用 HTTPS 協定' ['error.defaultBehavior.noReplace']='預設不更換' ['error.defaultBehavior.noOverwrite']='預設不覆蓋' @@ -8225,7 +8234,7 @@ function msg_pack_en() { ['error.unknownSystem']='Unknown system' ['error.unknownVersion']='System version unknown' ['error.input']='Input error, {}!' - ['error.needRoot']='Insufficient permissions, please run this script as Root user' + ['error.needRoot']='Insufficient privileges, please run this script as root. Switch command: {}' ['error.defaultBehavior.https']='HTTPS is used by default' ['error.defaultBehavior.noReplace']='No replacement by default' ['error.defaultBehavior.noOverwrite']='No overwrite by default' diff --git a/DockerInstallation.sh b/DockerInstallation.sh index 94da897..49cd41c 100755 --- a/DockerInstallation.sh +++ b/DockerInstallation.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Author: SuperManito -## Modified: 2025-11-02 +## Modified: 2025-11-04 ## License: MIT ## GitHub: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn @@ -501,7 +501,11 @@ function command_exists() { function permission_judgment() { if [ $UID -ne 0 ]; then - output_error "$(msg "error.needRoot")" + local change_cmd="su root" + if command_exists sudo; then + change_cmd="sudo -i" + fi + output_error "$(msg "error.needRoot" "${BLUE}${change_cmd}${PLAIN}")" fi } @@ -518,7 +522,7 @@ function collect_system_info() { SYSTEM_PRETTY_NAME="$(get_os_release_value PRETTY_NAME)" ## 定义系统版本号 SYSTEM_VERSION_ID="$(get_os_release_value VERSION_ID)" - SYSTEM_VERSION_ID_MAJOR="${SYSTEM_VERSION_ID%.*}" + SYSTEM_VERSION_ID_MAJOR="${SYSTEM_VERSION_ID%%.*}" SYSTEM_VERSION_ID_MINOR="${SYSTEM_VERSION_ID#*.}" ## 定义系统ID SYSTEM_ID="$(get_os_release_value ID)" @@ -2124,7 +2128,7 @@ function msg_pack_zh_hans() { ['error.unknownArch']='未知的系统架构:{}' ['error.unsupportS390x']='请查阅 RHEL 发行版声明以了解 s390x 支持' ['error.input']='输入错误,{}!' - ['error.needRoot']='权限不足,请使用 Root 用户运行本脚本' + ['error.needRoot']='权限不足,请切换至 root 账户后运行本脚本,切换命令 {}' ['error.sync']='{}出错,请先解决系统原有软件源错误以确保 {} 软件包管理工具可用!' ['error.downloadGPG']='GPG 密钥下载失败,请检查网络或更换 Docker CE 软件源后重试!' ['error.queryVersionFailed']='查询 Docker Engine 版本列表失败!' @@ -2275,7 +2279,7 @@ function msg_pack_zh_hant() { ['error.unknownArch']='未知的系統架構:{}' ['error.unsupportS390x']='請查閱 RHEL 發行版宣告以瞭解 s390x 支援' ['error.input']='輸入錯誤,{}!' - ['error.needRoot']='權限不足,請使用 Root 使用者執行本腳本' + ['error.needRoot']='權限不足,請切換至 root 帳戶後執行本腳本,切換指令 {}' ['error.sync']='{}出錯,請先解決系統原有軟體源錯誤以確保 {} 軟體包管理工具可用!' ['error.downloadGPG']='GPG 金鑰下載失敗,請檢查網路或更換 Docker CE 軟體源後重試!' ['error.queryVersionFailed']='查詢 Docker Engine 版本清單失敗!' @@ -2427,7 +2431,7 @@ function msg_pack_en() { ['error.unknownArch']='Unknown system architecture: {}' ['error.unsupportS390x']='Please refer to RHEL distribution announcement for s390x support' ['error.input']='Input error, {}!' - ['error.needRoot']='Insufficient permissions, please run this script as Root user' + ['error.needRoot']='Insufficient privileges, please run this script as root. Switch command: {}' ['error.sync']='{} failed. Please fix system software sources (package repositories) so the {} package manager is available!' ['error.downloadGPG']='GPG key download failed, please check network or switch Docker CE mirror and retry!' ['error.queryVersionFailed']='Failed to query Docker Engine version list!' diff --git a/README.en-US.md b/README.en-US.md index 8d9d966..c2b5070 100644 --- a/README.en-US.md +++ b/README.en-US.md @@ -26,103 +26,103 @@ Supported Versions -  Debian + Debian Debian 8 ~ 13 -  Ubuntu + Ubuntu Ubuntu 14 ~ 25 -  Kali Linux + Kali Linux Kali Linux all -  Linux Mint - 19 ~ 22 / LMDE 6 + Linux Mint Linux Mint + 17 ~ 22 / LMDE 2 ~ 7 -  Deepin + Deepin Deepin all -  Zorin OS + Zorin OS Zorin OS all -  Armbian + Armbian Armbian all -  Proxmox VE + Proxmox VE Proxmox VE all -  Raspberry Pi OS + Raspberry Pi OS Raspberry Pi OS all -  Red Hat Enterprise Linux + Red Hat Enterprise Linux Red Hat Enterprise Linux 7 ~ 10 -  Fedora + Fedora Fedora 30 ~ 42 -  CentOS + CentOS CentOS 7 ~ 8 / Stream 8 ~ 10 -  Rocky Linux + Rocky Linux Rocky Linux 8 ~ 10 -  AlmaLinux + AlmaLinux AlmaLinux 8 ~ 10 -  Oracle Linux + Oracle Linux Oracle Linux 8 ~ 10 -  openEuler + openEuler openEuler 20 ~ 25 -  OpenCloudOS + OpenCloudOS OpenCloudOS 8.6 ~ 9 / Stream 23 -  openKylin + openKylin openKylin all -  Anolis OS + Anolis OS Anolis OS 8 / 23 -  openSUSE + openSUSE openSUSE Leap 15 ~ 16 / Tumbleweed -  Arch Linux + Arch Linux Arch Linux all -  Manjaro + Manjaro Manjaro all -  Alpine Linux + Alpine Linux Alpine Linux v3 / edge -  Gentoo + Gentoo Gentoo all -  NixOS + NixOS NixOS 19 ~ 25 diff --git a/README.md b/README.md index 5c0d0d2..8924c55 100644 --- a/README.md +++ b/README.md @@ -26,103 +26,103 @@ 适配版本 -  Debian + Debian Debian 8 ~ 13 -  Ubuntu + Ubuntu Ubuntu 14 ~ 25 -  Kali Linux + Kali Linux Kali Linux all -  Linux Mint - 19 ~ 22 / LMDE 6 + Linux Mint Linux Mint + 17 ~ 22 / LMDE 2 ~ 7 -  Deepin(深度) + Deepin Deepin(深度) all -  Zorin OS + Zorin OS Zorin OS all -  Armbian + Armbian Armbian all -  Proxmox VE + Proxmox VE Proxmox VE all -  Raspberry Pi OS + Raspberry Pi OS Raspberry Pi OS all -  Red Hat Enterprise Linux + Red Hat Enterprise Linux Red Hat Enterprise Linux 7 ~ 10 -  Fedora + Fedora Fedora 30 ~ 42 -  CentOS + CentOS CentOS 7 ~ 8 / Stream 8 ~ 10 -  Rocky Linux + Rocky Linux Rocky Linux 8 ~ 10 -  AlmaLinux + AlmaLinux AlmaLinux 8 ~ 10 -  Oracle Linux + Oracle Linux Oracle Linux 8 ~ 10 -  openEuler(开源欧拉) + openEuler openEuler(开源欧拉) 20 ~ 25 -  OpenCloudOS(鸥栖) + OpenCloudOS OpenCloudOS(鸥栖) 8.6 ~ 9 / Stream 23 -  openKylin(开放麒麟) + openKylin openKylin(开放麒麟) all -  Anolis OS(龙蜥) + Anolis OS Anolis OS(龙蜥) 8 / 23 -  openSUSE + openSUSE openSUSE Leap 15 ~ 16 / Tumbleweed -  Arch Linux + Arch Linux Arch Linux all -  Manjaro + Manjaro Manjaro all -  Alpine Linux + Alpine Linux Alpine Linux v3 / edge -  Gentoo + Gentoo Gentoo all -  NixOS + NixOS NixOS 19 ~ 25 diff --git a/README.zh-Hant.md b/README.zh-Hant.md index 31fef1f..563e1ab 100644 --- a/README.zh-Hant.md +++ b/README.zh-Hant.md @@ -26,103 +26,103 @@ 適配版本 -  Debian + Debian Debian 8 ~ 13 -  Ubuntu + Ubuntu Ubuntu 14 ~ 25 -  Kali Linux + Kali Linux Kali Linux all -  Linux Mint - 19 ~ 22 / LMDE 6 + Linux Mint Linux Mint + 17 ~ 22 / LMDE 2 ~ 7 -  Deepin + Deepin Deepin all -  Zorin OS + Zorin OS Zorin OS all -  Armbian + Armbian Armbian all -  Proxmox VE + Proxmox VE Proxmox VE all -  Raspberry Pi OS + Raspberry Pi OS Raspberry Pi OS all -  Red Hat Enterprise Linux + Red Hat Enterprise Linux Red Hat Enterprise Linux 7 ~ 10 -  Fedora + Fedora Fedora 30 ~ 42 -  CentOS + CentOS CentOS 7 ~ 8 / Stream 8 ~ 10 -  Rocky Linux + Rocky Linux Rocky Linux 8 ~ 10 -  AlmaLinux + AlmaLinux AlmaLinux 8 ~ 10 -  Oracle Linux + Oracle Linux Oracle Linux 8 ~ 10 -  openEuler + openEuler openEuler 20 ~ 25 -  OpenCloudOS + OpenCloudOS OpenCloudOS 8.6 ~ 9 / Stream 23 -  openKylin + openKylin openKylin all -  Anolis OS + Anolis OS Anolis OS 8 / 23 -  openSUSE + openSUSE openSUSE Leap 15 ~ 16 / Tumbleweed -  Arch Linux + Arch Linux Arch Linux all -  Manjaro + Manjaro Manjaro all -  Alpine Linux + Alpine Linux Alpine Linux v3 / edge -  Gentoo + Gentoo Gentoo all -  NixOS + NixOS NixOS 19 ~ 25 diff --git a/docs/assets/images/icon/armbian.png b/docs/assets/images/icon/armbian.png index 22deb53..667d223 100644 Binary files a/docs/assets/images/icon/armbian.png and b/docs/assets/images/icon/armbian.png differ diff --git a/docs/assets/images/icon/linux-mint.ico b/docs/assets/images/icon/linux-mint.ico deleted file mode 100644 index 50089a3..0000000 Binary files a/docs/assets/images/icon/linux-mint.ico and /dev/null differ diff --git a/docs/assets/images/icon/linux-mint.svg b/docs/assets/images/icon/linux-mint.svg new file mode 100644 index 0000000..41daf54 --- /dev/null +++ b/docs/assets/images/icon/linux-mint.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/js/components/mirrors-table/data.js b/docs/assets/js/components/mirrors-table/data.js index a14983e..3884d0f 100644 --- a/docs/assets/js/components/mirrors-table/data.js +++ b/docs/assets/js/components/mirrors-table/data.js @@ -775,7 +775,7 @@ const mirrorsTableFilterSelectOptions = [ { value: 'linuxmint', label: 'Linux Mint', - iconName: 'linux-mint.ico', + iconName: 'linux-mint.svg', }, { value: 'deepin', diff --git a/docs/index.en.md b/docs/index.en.md index ab1564b..85633ba 100644 --- a/docs/index.en.md +++ b/docs/index.en.md @@ -105,31 +105,31 @@ hide: | Operating System | Supported Versions | | --- | :---: | -| **Debian** | _8~13_ | -| **Ubuntu** :material-information-outline:{ title="Supports Ubuntu family derivatives, such as UKylin, Kubuntu, etc.
Due to rapid iteration, not all non-LTS versions are directly supported. See documentation for details." } | _14~25_ | -| **Kali Linux** | _all_ | -| **Linux Mint** | _19~22 / LMDE 6_ | -| **Deepin** | _all_ | -| **Zorin OS** | _all_ | -| **Armbian** | _all_ | -| **Proxmox VE** | _all_ | -| **Raspberry Pi OS** | _all_ | -| **Red Hat Enterprise Linux** :material-information-outline:{ title="Uses CentOS Stream or CentOS mirrors" } | _7~10_ | -| **Fedora** | _30~42_ | -| **CentOS** | _7~8 / Stream 8~10_ | -| **Rocky Linux** | _8~10_ | -| **AlmaLinux** | _8~10_ | -| **Oracle Linux** :material-information-outline:{ title="Uses CentOS Stream mirrors" } | _8~10_ | -| **openEuler** | _20~25_ | -| **OpenCloudOS** | _8.6~9 / Stream 23_ | -| **openKylin** | _all_ | -| **Anolis OS** | _8 / 23_ | -| **openSUSE** | _Leap 15 ~ 16 / Tumbleweed_ | -| **Arch Linux** | _all_ | -| **Manjaro** | _all_ | -| **Alpine Linux** | _v3 / edge_ | -| **Gentoo** | _all_ | -| **NixOS** | _19~25_ | +| Debian **Debian** | _8~13_ | +| Ubuntu **Ubuntu** :material-information-outline:{ title="Supports Ubuntu family derivatives, such as UKylin, Kubuntu, etc.
Due to rapid iteration, not all non-LTS versions are directly supported. See documentation for details." } | _14~25_ | +| Kali Linux **Kali Linux** | _all_ | +| Linux Mint **Linux Mint** | _17~22 / LMDE 2~7_ | +| Deepin **Deepin** | _all_ | +| Zorin OS **Zorin OS** | _all_ | +| Armbian **Armbian** | _all_ | +| Proxmox VE **Proxmox VE** | _all_ | +| Raspberry Pi OS **Raspberry Pi OS** | _all_ | +| Red Hat Enterprise Linux **Red Hat Enterprise Linux** :material-information-outline:{ title="Uses CentOS Stream or CentOS mirrors" } | _7~10_ | +| Fedora **Fedora** | _30~42_ | +| CentOS **CentOS** | _7~8 / Stream 8~10_ | +| Rocky Linux **Rocky Linux** | _8~10_ | +| AlmaLinux **AlmaLinux** | _8~10_ | +| Oracle Linux **Oracle Linux** :material-information-outline:{ title="Uses CentOS Stream mirrors" } | _8~10_ | +| openEuler **openEuler** | _20~25_ | +| OpenCloudOS **OpenCloudOS** | _8.6~9 / Stream 23_ | +| openKylin **openKylin** | _all_ | +| Anolis OS **Anolis OS** | _8 / 23_ | +| openSUSE **openSUSE** | _Leap 15 ~ 16 / Tumbleweed_ | +| Arch Linux **Arch Linux** | _all_ | +| Manjaro **Manjaro** | _all_ | +| Alpine Linux **Alpine Linux** | _v3 / edge_ | +| Gentoo **Gentoo** | _all_ | +| NixOS **NixOS** | _19~25_ | diff --git a/docs/index.md b/docs/index.md index 5df73b3..76ef2ea 100644 --- a/docs/index.md +++ b/docs/index.md @@ -105,31 +105,31 @@ hide: | 操作系统 | 适配版本 | | --- | :---: | -| **Debian** | _8~13_ | -| **Ubuntu** :material-information-outline:{ title="支持乌班图家族衍生操作系统,例如 优麒麟 Kubuntu
由于迭代速度较快并不直接支持所有非 LTS 的版本,具体详见文档" } | _14~25_ | -| **Kali Linux** | _all_ | -| **Linux Mint** | _19~22 / LMDE 6_ | -| **Deepin(深度)** | _all_ | -| **Zorin OS** | _all_ | -| **Armbian** | _all_ | -| **Proxmox VE** | _all_ | -| **Raspberry Pi OS** | _all_ | -| **Red Hat Enterprise Linux** :material-information-outline:{ title="使用 CentOS StreamCentOS 源" } | _7~10_ | -| **Fedora** | _30~42_ | -| **CentOS** | _7~8 / Stream 8~10_ | -| **Rocky Linux** | _8~10_ | -| **AlmaLinux** | _8~10_ | -| **Oracle Linux** :material-information-outline:{ title="使用 CentOS Stream 源" } | _8~10_ | -| **openEuler(开源欧拉)** | _20~25_ | -| **OpenCloudOS(鸥栖)** | _8.6~9 / Stream 23_ | -| **openKylin(开放麒麟)** | _all_ | -| **Anolis OS(龙蜥)** | _8 / 23_ | -| **openSUSE** | _Leap 15 ~ 16 / Tumbleweed_ | -| **Arch Linux** | _all_ | -| **Manjaro** | _all_ | -| **Alpine Linux** | _v3 / edge_ | -| **Gentoo** | _all_ | -| **NixOS** | _19~25_ | +| Debian **Debian** | _8~13_ | +| Ubuntu **Ubuntu** :material-information-outline:{ title="支持乌班图家族衍生操作系统,例如 优麒麟 Kubuntu
由于迭代速度较快并不直接支持所有非 LTS 的版本,具体详见文档" } | _14~25_ | +| Kali Linux **Kali Linux** | _all_ | +| Linux Mint **Linux Mint** | _17~22 / LMDE 2~7_ | +| Deepin **Deepin(深度)** | _all_ | +| Zorin OS **Zorin OS** | _all_ | +| Armbian **Armbian** | _all_ | +| Proxmox VE **Proxmox VE** | _all_ | +| Raspberry Pi OS **Raspberry Pi OS** | _all_ | +| Red Hat Enterprise Linux **Red Hat Enterprise Linux** :material-information-outline:{ title="使用 CentOS StreamCentOS 源" } | _7~10_ | +| Fedora **Fedora** | _30~42_ | +| CentOS **CentOS** | _7~8 / Stream 8~10_ | +| Rocky Linux **Rocky Linux** | _8~10_ | +| AlmaLinux **AlmaLinux** | _8~10_ | +| Oracle Linux **Oracle Linux** :material-information-outline:{ title="使用 CentOS Stream 源" } | _8~10_ | +| openEuler **openEuler(开源欧拉)** | _20~25_ | +| OpenCloudOS **OpenCloudOS(鸥栖)** | _8.6~9 / Stream 23_ | +| openKylin **openKylin(开放麒麟)** | _all_ | +| Anolis OS **Anolis OS(龙蜥)** | _8 / 23_ | +| openSUSE **openSUSE** | _Leap 15 ~ 16 / Tumbleweed_ | +| Arch Linux **Arch Linux** | _all_ | +| Manjaro **Manjaro** | _all_ | +| Alpine Linux **Alpine Linux** | _v3 / edge_ | +| Gentoo **Gentoo** | _all_ | +| NixOS **NixOS** | _19~25_ | diff --git a/docs/index.zh-Hant.md b/docs/index.zh-Hant.md index e340686..359bddf 100644 --- a/docs/index.zh-Hant.md +++ b/docs/index.zh-Hant.md @@ -105,31 +105,31 @@ hide: | 作業系統 | 適配版本 | | --- | :---: | -| **Debian** | _8~13_ | -| **Ubuntu** :material-information-outline:{ title="支援烏班圖家族衍生作業系統,例如 優麒麟 Kubuntu
由於迭代速度較快並不直接支援所有非 LTS 的版本,因此具體詳見文件" } | _14~25_ | -| **Kali Linux** | _all_ | -| **Linux Mint** | _19~22 / LMDE 6_ | -| **Deepin** | _all_ | -| **Zorin OS** | _all_ | -| **Armbian** | _all_ | -| **Proxmox VE** | _all_ | -| **Raspberry Pi OS** | _all_ | -| **Red Hat Enterprise Linux** :material-information-outline:{ title="使用 CentOS StreamCentOS 源" } | _7~10_ | -| **Fedora** | _30~42_ | -| **CentOS** | _7~8 / Stream 8~10_ | -| **Rocky Linux** | _8~10_ | -| **AlmaLinux** | _8~10_ | -| **Oracle Linux** :material-information-outline:{ title="使用 CentOS Stream 源" } | _8~10_ | -| **openEuler** | _20~25_ | -| **OpenCloudOS** | _8.6~9 / Stream 23_ | -| **openKylin** | _all_ | -| **Anolis OS** | _8 / 23_ | -| **openSUSE** | _Leap 15 ~ 16 / Tumbleweed_ | -| **Arch Linux** | _all_ | -| **Manjaro** | _all_ | -| **Alpine Linux** | _v3 / edge_ | -| **Gentoo** | _all_ | -| **NixOS** | _19~25_ | +| Debian **Debian** | _8~13_ | +| Ubuntu **Ubuntu** :material-information-outline:{ title="支援烏班圖家族衍生作業系統,例如 優麒麟 Kubuntu
由於迭代速度較快並不直接支援所有非 LTS 的版本,因此具體詳見文件" } | _14~25_ | +| Kali Linux **Kali Linux** | _all_ | +| Linux Mint **Linux Mint** | _17~22 / LMDE 2~7_ | +| Deepin **Deepin** | _all_ | +| Zorin OS **Zorin OS** | _all_ | +| Armbian **Armbian** | _all_ | +| Proxmox VE **Proxmox VE** | _all_ | +| Raspberry Pi OS **Raspberry Pi OS** | _all_ | +| Red Hat Enterprise Linux **Red Hat Enterprise Linux** :material-information-outline:{ title="使用 CentOS StreamCentOS 源" } | _7~10_ | +| Fedora **Fedora** | _30~42_ | +| CentOS **CentOS** | _7~8 / Stream 8~10_ | +| Rocky Linux **Rocky Linux** | _8~10_ | +| AlmaLinux **AlmaLinux** | _8~10_ | +| Oracle Linux **Oracle Linux** :material-information-outline:{ title="使用 CentOS Stream 源" } | _8~10_ | +| openEuler **openEuler** | _20~25_ | +| OpenCloudOS **OpenCloudOS** | _8.6~9 / Stream 23_ | +| openKylin **openKylin** | _all_ | +| Anolis OS **Anolis OS** | _8 / 23_ | +| openSUSE **openSUSE** | _Leap 15 ~ 16 / Tumbleweed_ | +| Arch Linux **Arch Linux** | _all_ | +| Manjaro **Manjaro** | _all_ | +| Alpine Linux **Alpine Linux** | _v3 / edge_ | +| Gentoo **Gentoo** | _all_ | +| NixOS **NixOS** | _19~25_ | diff --git a/docs/use/index.en.md b/docs/use/index.en.md index 36f5448..0fa79c5 100644 --- a/docs/use/index.en.md +++ b/docs/use/index.en.md @@ -151,17 +151,17 @@ hide:
-- :material-numeric-1:{style="color: #5b84f5" .lg} __Run the script as `ROOT` user__ +- :material-numeric-1:{style="color: #5b84f5" .lg} __`ROOT` privileges required__ --- - Switch command: `sudo -i` or `su root`. Different systems use different commands because some systems do not set a password for the ROOT account during initial installation (such as Ubuntu) or the system disables ROOT login by default. + Please run this script using the `root` account. Switch commands are `sudo -i` or `su root`. Different systems use different commands because some systems do not set a password for the root account during initial installation (e.g., Ubuntu) or disable `root` account login by default. - :material-numeric-2:{style="color: #5b84f5" .lg} __It is recommended to use a modern `SSH` client__ --- - If your terminal displays garbled Chinese, you will not be able to see the interactive content. Some GUI terminal apps may have unpredictable display issues. Some systems automatically enable SSH service; otherwise, see [how to enable SSH](#how-to-enable-ssh-remote-login). + The system's GUI graphical interface terminal application may experience some unpredictable display issues. Some systems will automatically enable the SSH service; otherwise, please refer to [how to enable SSH](#how-to-enable-ssh-remote-login). - :material-numeric-3:{style="color: #5b84f5" .lg} __If running the script for the first time on a new system__ @@ -285,7 +285,7 @@ hide: - #### Restore backed up mirrors - !!! quote "" + ??? quote "Click to expand and view" === "Debian-based / openKylin" @@ -352,36 +352,79 @@ hide: - #### How to enable SSH remote login - !!! quote "" + ??? quote "Click to expand and view" - The commands and steps are for reference only and only cover some common distributions. + The commands and configuration steps are for reference only; please be flexible and adapt them accordingly. - Check if `SSH` service is installed ``` bash ls /etc | grep ssh ``` - > If this folder does not exist, SSH is not installed. Install the `openssh` package with your package manager. - > Note that package names may differ; you can use `openssh*` as a wildcard. - - Allow Root login + If this folder does not exist, SSH is not installed. Install the `openssh-server` package with your package manager. The installation command is as follows: - ``` bash + === "Debian-based / openKylin" + + ``` bash + apt-get install -y openssh-server + ``` + + > `Debian`   `Ubuntu`   `Kali`   `Linux Mint`   `Deepin`   `Zorin OS`   `Armbian`   `Proxmox VE`   `Raspberry Pi OS`   `openKylin` + + For new systems, run `apt-get update` first. + + === "RedHat-based / openEuler / OpenCloudOS / Anolis OS" + + ``` bash + dnf install -y openssh-server || yum install -y openssh-server + ``` + + > `Red Hat Enterprise Linux`   `CentOS`   `Rocky Linux`   `AlmaLinux`   `Fedora`   `openEuler`   `OpenCloudOS`   `Anolis OS` + + === "openSUSE" + + ``` bash + zypper install openssh-server + ``` + + === "Arch Linux / Manjaro" + + ``` bash + pacman -S openssh + ``` + + === "Alpine Linux" + + ``` bash + apk --no-cache add -f openssh + ``` + + === "Gentoo" + + ``` bash + emerge --ask --changed-use --oneshot net-misc/openssh + ``` + + > Package names may vary across different systems. If you encounter a "package not found" error, try using wildcards `openssh*` to install it. + + - Configure `SSH` service + + ``` { .bash .no-copy title="Allow root account login" } cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PermitRootLogin " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config ``` - - Enable password authentication - - ``` bash + ``` { .bash .no-copy title="Enable password authentication" } cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PasswordAuthentication " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || echo -e "\nPasswordAuthentication yes" >> /etc/ssh/sshd_config ``` - Start/restart `SSH` service ``` bash - ps -ef | grep -q ssh ; [ $? -eq 0 ] && systemctl restart sshd || systemctl enable --now sshd + for ssh_svc in sshd ssh openssh; do systemctl restart "${ssh_svc}" 2>/dev/null && break ; systemctl enable --now "${ssh_svc}" 2>/dev/null && break ; done ``` - > Service names may differ; if not `sshd`, try `ssh`. + + !!! tip "Friendly reminder: If you are using a public server, it is recommended to disable SSH password authentication and set up key-based login." - #### No arrow key interactive UI @@ -543,31 +586,31 @@ Below are some advanced usage examples | OS Name | Names Involved | | --- | :---: | - | **Debian** | `debian` `debian-archive` | - | **Ubuntu** | `ubuntu` `ubuntu-ports` | - | **Kali Linux** | `kali` | - | **Linux Mint** | `linuxmint` `ubuntu` `ubuntu-ports` `debian` | - | **Deepin(深度)** | `deepin` | - | **Zorin OS** | `ubuntu` `ubuntu-ports` | - | **Armbian** | `armbian` | - | **Proxmox VE** | `proxmox` | - | **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` | - | **Rocky Linux** | `rocky` | - | **AlmaLinux** | `almalinux` `almalinux-vault` | - | **Oracle Linux** | `centos-stream` | - | **openEuler** | `openeuler` | - | **OpenCloudOS** | `opencloudos` | - | **openKylin** | `openkylin` | - | **Anolis OS** | `anolis` | - | **openSUSE** | `opensuse` | - | **Arch Linux** | `archlinux` `archlinuxarm` | - | **Manjaro** | `manjaro` | - | **Alpine Linux** | `alpine` | - | **Gentoo** | `gentoo` `gentoo-portage` | - | **NixOS** | `nix-channels` | + | Debian **Debian** | `debian` `debian-archive` | + | Ubuntu **Ubuntu** | `ubuntu` `ubuntu-ports` | + | Kali Linux **Kali Linux** | `kali` | + | Linux Mint **Linux Mint** | `linuxmint` `ubuntu` `ubuntu-ports` `debian` | + | Deepin **Deepin(深度)** | `deepin` | + | Zorin OS **Zorin OS** | `ubuntu` `ubuntu-ports` | + | Armbian **Armbian** | `armbian` | + | Proxmox VE **Proxmox VE** | `proxmox` | + | Raspberry Pi OS **Raspberry Pi OS** | `raspberrypi` `raspbian` `debian` `debian-archive` | + | Red Hat Enterprise Linux **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` `fedora-archive` | + | CentOS **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | Rocky Linux **Rocky Linux** | `rocky` | + | AlmaLinux **AlmaLinux** | `almalinux` `almalinux-vault` | + | Oracle Linux **Oracle Linux** | `centos-stream` | + | openEuler **openEuler** | `openeuler` | + | OpenCloudOS **OpenCloudOS** | `opencloudos` | + | openKylin **openKylin** | `openkylin` | + | Anolis OS **Anolis OS** | `anolis` | + | openSUSE **openSUSE** | `opensuse` | + | Arch Linux **Arch Linux** | `archlinux` `archlinuxarm` | + | Manjaro **Manjaro** | `manjaro` | + | Alpine Linux **Alpine Linux** | `alpine` | + | Gentoo **Gentoo** | `gentoo` `gentoo-portage` | + | NixOS **NixOS** | `nix-channels` | Example: diff --git a/docs/use/index.md b/docs/use/index.md index 4698694..dde428e 100644 --- a/docs/use/index.md +++ b/docs/use/index.md @@ -153,29 +153,29 @@ hide:
-- :material-numeric-1:{style="color: #5b84f5" .lg} __需使用 `ROOT` 用户执行脚本__ +- :material-numeric-1:{style="color: #5b84f5" .lg} __需要 `ROOT` 权限__ --- - 切换命令为 `sudo -i` 或 `su root`。不同系统使用的命令不同,因为部分系统没有在初始安装时为 ROOT 账户设置密码(例如 Ubuntu)或系统默认禁止 ROOT 用户登录。 + 请使用 `root` 账户运行本脚本,切换命令为 `sudo -i` 或 `su root`。不同系统使用的命令不同,因为部分系统没有在初始安装时为 root 账户设置密码(例如 Ubuntu)或系统默认禁止 `root` 账户登录。 - :material-numeric-2:{style="color: #5b84f5" .lg} __建议使用现代化的 `SSH` 客户端应用__ --- - 如果你系统命令行界面的中文显示乱码那么将导致无法查看交互内容,此外部分系统 GUI 图形界面的终端应用可能存在一些无法预料的显示问题。部分系统会自动开启 SSH 服务,否则请参考[开启方法](#关于开启-ssh-远程登录的方法)。 + 如果系统命令行界面的中文显示乱码,将导致无法查看交互内容,此外部分系统 GUI 图形界面的终端应用可能存在一些无法预料的显示问题。部分系统会自动开启 SSH 服务,否则请参考[开启方法](#关于开启-ssh-远程登录的方法)。 - :material-numeric-3:{style="color: #5b84f5" .lg} __如果是在新装系统上首次执行脚本__ --- - 当前依赖 `curl` 指令获取脚本内容,但部分操作系统没有预装此软件包,届时则会报错 `Command not found`,安装方法详见下方 [_关于报错 Command not found_](#关于报错-command-not-found)。脚本本身与 `curl` `wget` 指令无关,更不会下载任何内容。 + 当前依赖 `curl` 指令获取脚本内容,但部分操作系统未预装此软件包,将会报错 `Command not found`,安装方法详见下方 [_关于报错 Command not found_](#关于报错-command-not-found)。脚本本身与 `curl` `wget` 指令无关,不会下载任何内容。 - :material-numeric-4:{style="color: #5b84f5" .lg} __脚本运行期间需要交互选择配置__ --- - 请通过方向键 ++arrow-up++++arrow-down++++arrow-left++++arrow-right++ 或 ++w++++a++++s++++d++ 控制选项并按 ++enter++ 回车键确认。如果发现交互异常那么请改变终端软件的窗口大小后重试,另外窗口不要铺满全屏。 + 请通过方向键 ++arrow-up++++arrow-down++++arrow-left++++arrow-right++ 或 ++w++++a++++s++++d++ 控制选项并按 ++enter++ 回车键确认。如果发现交互异常请改变终端软件的窗口大小后重试,避免窗口铺满全屏。
@@ -287,7 +287,7 @@ hide: - #### 还原已备份的软件源 - !!! quote "" + ??? quote "点击展开查看" === "Debian 系 / openKylin" @@ -354,36 +354,79 @@ hide: - #### 关于开启 SSH 远程登录的方法 - !!! quote "" + ??? quote "点击展开查看" - 命令以及配置步骤仅供参考,只适配了部分常见发行版 + 命令以及配置步骤仅供参考,注意灵活变通 - 验证是否已安装 `SSH` 服务 ``` bash ls /etc | grep ssh ``` - > 如果没有这个文件夹说明系统未安装 `SSH` 服务,你需要通过包管理工具安装 `openssh` 软件包 - > 需要注意的是不同系统上的软件包名称有所差异,可直接使用 `openssh*` 通配符进行安装 - - 设置允许 Root 用户登录 + 如果没有这个文件夹说明系统未安装 `SSH` 服务,你需要通过包管理工具安装 `openssh-server` 软件包,安装命令如下: - ``` bash + === "Debian 系 / openKylin" + + ``` bash + apt-get install -y openssh-server + ``` + + > `Debian`   `Ubuntu`   `Kali`   `Linux Mint`   `Deepin`   `Zorin OS`   `Armbian`   `Proxmox VE`   `Raspberry Pi OS`   `openKylin` + + 新装系统需要先执行一遍更新 `apt-get update` + + === "RedHat 系 / openEuler / OpenCloudOS / Anolis OS" + + ``` bash + dnf install -y openssh-server || yum install -y openssh-server + ``` + + > `Red Hat Enterprise Linux`   `CentOS`   `Rocky Linux`   `AlmaLinux`   `Fedora`   `openEuler`   `OpenCloudOS`   `Anolis OS` + + === "openSUSE" + + ``` bash + zypper install openssh-server + ``` + + === "Arch Linux / Manjaro" + + ``` bash + pacman -S openssh + ``` + + === "Alpine Linux" + + ``` bash + apk --no-cache add -f openssh + ``` + + === "Gentoo" + + ``` bash + emerge --ask --changed-use --oneshot net-misc/openssh + ``` + + > 不同系统上的软件包名称有所差异,如果提示找不到该软件包可尝试使用通配符 `openssh*` 进行安装 + + - 配置 `SSH` 服务 + + ``` { .bash .no-copy title="允许 root 账户登录" } cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PermitRootLogin " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config ``` - - 设置密码认证 - - ``` bash + ``` { .bash .no-copy title="启用密码认证" } cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PasswordAuthentication " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || echo -e "\nPasswordAuthentication yes" >> /etc/ssh/sshd_config ``` - 启动/重启 `SSH` 服务 ``` bash - ps -ef | grep -q ssh ; [ $? -eq 0 ] && systemctl restart sshd || systemctl enable --now sshd + for ssh_svc in sshd ssh; do systemctl restart "${ssh_svc}" 2>/dev/null && break ; systemctl enable --now "${ssh_svc}" 2>/dev/null && break ; done ``` - > 不同系统上的服务名称有所差异,如果不是 `sshd` 那就试试 `ssh` + + !!! tip "友情提示:如果你正在使用公网服务器,建议关闭 SSH 密码认证方式并设置密钥登录。" - #### 关于未显示方向键交互控制界面 @@ -545,31 +588,31 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help | 系统名称 | 涉及的名称 | | --- | :---: | - | **Debian** | `debian` `debian-archive` | - | **Ubuntu** | `ubuntu` `ubuntu-ports` | - | **Kali Linux** | `kali` | - | **Linux Mint** | `linuxmint` `ubuntu` `ubuntu-ports` `debian` | - | **Deepin(深度)** | `deepin` | - | **Zorin OS** | `ubuntu` `ubuntu-ports` | - | **Armbian** | `armbian` | - | **Proxmox VE** | `proxmox` | - | **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` | - | **Rocky Linux** | `rocky` | - | **AlmaLinux** | `almalinux` `almalinux-vault` | - | **Oracle Linux** | `centos-stream` | - | **openEuler(开源欧拉)** | `openeuler` | - | **OpenCloudOS(鸥栖)** | `opencloudos` | - | **openKylin(开放麒麟)** | `openkylin` | - | **Anolis OS(龙蜥)** | `anolis` | - | **openSUSE** | `opensuse` | - | **Arch Linux** | `archlinux` `archlinuxarm` | - | **Manjaro** | `manjaro` | - | **Alpine Linux** | `alpine` | - | **Gentoo** | `gentoo` `gentoo-portage` | - | **NixOS** | `nix-channels` | + | Debian **Debian** | `debian` `debian-archive` | + | Ubuntu **Ubuntu** | `ubuntu` `ubuntu-ports` | + | Kali Linux **Kali Linux** | `kali` | + | Linux Mint **Linux Mint** | `linuxmint` `ubuntu` `ubuntu-ports` `debian` | + | Deepin **Deepin(深度)** | `deepin` | + | Zorin OS **Zorin OS** | `ubuntu` `ubuntu-ports` | + | Armbian **Armbian** | `armbian` | + | Proxmox VE **Proxmox VE** | `proxmox` | + | Raspberry Pi OS **Raspberry Pi OS** | `raspberrypi` `raspbian` `debian` `debian-archive` | + | Red Hat Enterprise Linux **Red Hat Enterprise Linux** :material-information-outline:{ title="9版本使用 CentOS Stream, 7、8版本使用CentOS" } | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | Fedora **Fedora** | `fedora` `fedora-archive` | + | CentOS **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | Rocky Linux **Rocky Linux** | `rocky` | + | AlmaLinux **AlmaLinux** | `almalinux` `almalinux-vault` | + | Oracle Linux **Oracle Linux** | `centos-stream` | + | openEuler **openEuler(开源欧拉)** | `openeuler` | + | OpenCloudOS **OpenCloudOS(鸥栖)** | `opencloudos` | + | openKylin **openKylin(开放麒麟)** | `openkylin` | + | Anolis OS **Anolis OS(龙蜥)** | `anolis` | + | openSUSE **openSUSE** | `opensuse` | + | Arch Linux **Arch Linux** | `archlinux` `archlinuxarm` | + | Manjaro **Manjaro** | `manjaro` | + | Alpine Linux **Alpine Linux** | `alpine` | + | Gentoo **Gentoo** | `gentoo` `gentoo-portage` | + | NixOS **NixOS** | `nix-channels` | 请看下面的例子 diff --git a/docs/use/index.zh-Hant.md b/docs/use/index.zh-Hant.md index 477227b..66bbd8a 100644 --- a/docs/use/index.zh-Hant.md +++ b/docs/use/index.zh-Hant.md @@ -153,29 +153,29 @@ hide:
-- :material-numeric-1:{style="color: #5b84f5" .lg} __需使用 `ROOT` 執行腳本__ +- :material-numeric-1:{style="color: #5b84f5" .lg} __需要 `ROOT` 權限__ --- - 切換指令為 `sudo -i` 或 `su root`。不同系統使用的命令不同,因為部分系統沒有在初始安裝時為 ROOT 帳戶設定密碼(例如 Ubuntu)或系統預設禁止 ROOT 登入。 + 請使用 `root` 帳戶執行本腳本,切換指令為 `sudo -i` 或 `su root`。不同系統使用的指令不同,因為部分系統沒有在初始安裝時為 root 帳戶設定密碼(例如 Ubuntu)或系統預設禁止 `root` 帳戶登入。 - :material-numeric-2:{style="color: #5b84f5" .lg} __建議使用現代化的 `SSH` 用戶端應用__ --- - 如果你系統命令列介面的中文顯示亂碼那麼將導致無法查看互動內容,此外部分系統 GUI 圖形介面的終端應用可能存在一些無法預料的顯示問題。部分系統會自動開啟 SSH 服務,否則請參考[開啟方法](#關於開啟-ssh-遠端登入的方法)。 + 如果系統命令列介面的中文顯示亂碼,將導致無法查看互動內容,此外部分系統 GUI 圖形介面的終端應用可能存在一些無法預料的顯示問題。部分系統會自動開啟 SSH 服務,否則請參考[開啟方法](#關於開啟-ssh-遠端登入的方法)。 - :material-numeric-3:{style="color: #5b84f5" .lg} __如果是在新裝系統上首次執行腳本__ --- - 目前依賴 `curl` 指令取得腳本內容,但部分作業系統沒有預先安裝此軟體包,屆時則會報錯 `Command not found`,安裝方法詳見下方 [_關於報錯 Command not found_](#關於報錯-command-not-found)。腳本本身與 `curl` `wget` 指令無關,更不會下載任何內容。 + 目前依賴 `curl` 指令取得腳本內容,但部分作業系統未預先安裝此軟體包,將會報錯 `Command not found`,安裝方法詳見下方 [_關於報錯 Command not found_](#關於報錯-command-not-found)。腳本本身與 `curl` `wget` 指令無關,不會下載任何內容。 - :material-numeric-4:{style="color: #5b84f5" .lg} __腳本運行期間需要互動選擇配置__ --- - 請透過方向鍵 ++arrow-up++++arrow-down++++arrow-left++++arrow-right++ 或 ++w++++a++++s++++d++ 控制選項並按 ++enter++ 回車鍵確認。如果發現互動異常那麼請改變終端軟體的視窗大小後重試,另外視窗不要鋪滿全螢幕。 + 請透過方向鍵 ++arrow-up++++arrow-down++++arrow-left++++arrow-right++ 或 ++w++++a++++s++++d++ 控制選項並按 ++enter++ 回車鍵確認。如果發現互動異常請改變終端軟體的視窗大小後重試,避免視窗鋪滿全螢幕。
@@ -287,7 +287,7 @@ hide: - #### 還原已備份的軟體源 - !!! quote "" + ??? quote "點擊展開查看" === "Debian 系 / openKylin" @@ -354,36 +354,79 @@ hide: - #### 關於開啟 SSH 遠端登入的方法 - !!! quote "" + ??? quote "點擊展開查看" - 命令以及設定步驟僅供參考,只適配了部分常見發行版 + 指令以及設定步驟僅供參考,注意靈活變通 - 驗證是否已安裝 `SSH` 服務 ``` bash ls /etc | grep ssh ``` - > 如果沒有這個資料夾說明系統未安裝 `SSH` 服務,你需要透過套件管理工具安裝 `openssh` 軟體包 - > 要注意的是不同系統上的軟體包名稱有所差異,可直接使用 `openssh*` 通配符進行安裝 - - 設定允許 Root 登入 + 如果沒有這個資料夾說明系統未安裝 `SSH` 服務,你需要透過套件管理工具安裝 `openssh-server` 軟體包,安裝指令如下: - ``` bash + === "Debian 系 / openKylin" + + ``` bash + apt-get install -y openssh-server + ``` + + > `Debian`   `Ubuntu`   `Kali`   `Linux Mint`   `Deepin`   `Zorin OS`   `Armbian`   `Proxmox VE`   `Raspberry Pi OS`   `openKylin` + + 新裝系統需要先執行一遍更新 `apt-get update` + + === "RedHat 系 / openEuler / OpenCloudOS / Anolis OS" + + ``` bash + dnf install -y openssh-server || yum install -y openssh-server + ``` + + > `Red Hat Enterprise Linux`   `CentOS`   `Rocky Linux`   `AlmaLinux`   `Fedora`   `openEuler`   `OpenCloudOS`   `Anolis OS` + + === "openSUSE" + + ``` bash + zypper install openssh-server + ``` + + === "Arch Linux / Manjaro" + + ``` bash + pacman -S openssh + ``` + + === "Alpine Linux" + + ``` bash + apk --no-cache add -f openssh + ``` + + === "Gentoo" + + ``` bash + emerge --ask --changed-use --oneshot net-misc/openssh + ``` + + > 不同系統上的軟體包名稱有所差異,如果提示找不到該軟體包可嘗試使用通配符 `openssh*` 進行安裝 + + - 設定 `SSH` 服務 + + ``` { .bash .no-copy title="允許 root 帳戶登入" } cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PermitRootLogin " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config ``` - - 設定密碼認證 - - ``` bash + ``` { .bash .no-copy title="啟用密碼認證" } cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PasswordAuthentication " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || echo -e "\nPasswordAuthentication yes" >> /etc/ssh/sshd_config ``` - 啟動/重啟 `SSH` 服務 ``` bash - ps -ef | grep -q ssh ; [ $? -eq 0 ] && systemctl restart sshd || systemctl enable --now sshd + for ssh_svc in sshd ssh openssh; do systemctl restart "${ssh_svc}" 2>/dev/null && break ; systemctl enable --now "${ssh_svc}" 2>/dev/null && break ; done ``` - > 不同系統上的服務名稱有所差異,如果不是 `sshd` 那就試試 `ssh` + + !!! tip "友情提示:如果你正在使用公網伺服器,建議關閉 SSH 密碼認證方式並設定金鑰登入。" - #### 關於未顯示方向鍵交互控制介面 @@ -545,31 +588,31 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --zh-hant --help | 系統名稱 | 涉及的名稱 | | --- | :---: | - | **Debian** | `debian` `debian-archive` | - | **Ubuntu** | `ubuntu` `ubuntu-ports` | - | **Kali Linux** | `kali` | - | **Linux Mint** | `linuxmint` `ubuntu` `ubuntu-ports` `debian` | - | **Deepin** | `deepin` | - | **Zorin OS** | `ubuntu` `ubuntu-ports` | - | **Armbian** | `armbian` | - | **Proxmox VE** | `proxmox` | - | **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` | - | **Rocky Linux** | `rocky` | - | **AlmaLinux** | `almalinux` `almalinux-vault` | - | **Oracle Linux** | `centos-stream` | - | **openEuler** | `openeuler` | - | **OpenCloudOS** | `opencloudos` | - | **openKylin** | `openkylin` | - | **Anolis OS** | `anolis` | - | **openSUSE** | `opensuse` | - | **Arch Linux** | `archlinux` `archlinuxarm` | - | **Manjaro** | `manjaro` | - | **Alpine Linux** | `alpine` | - | **Gentoo** | `gentoo` `gentoo-portage` | - | **NixOS** | `nix-channels` | + | Debian **Debian** | `debian` `debian-archive` | + | Ubuntu **Ubuntu** | `ubuntu` `ubuntu-ports` | + | Kali Linux **Kali Linux** | `kali` | + | Linux Mint **Linux Mint** | `linuxmint` `ubuntu` `ubuntu-ports` `debian` | + | Deepin **Deepin** | `deepin` | + | Zorin OS **Zorin OS** | `ubuntu` `ubuntu-ports` | + | Armbian **Armbian** | `armbian` | + | Proxmox VE **Proxmox VE** | `proxmox` | + | Raspberry Pi OS **Raspberry Pi OS** | `raspberrypi` `raspbian` `debian` `debian-archive` | + | Red Hat Enterprise Linux **Red Hat Enterprise Linux** :material-information-outline:{ title="9版本使用 CentOS Stream, 7、8版本使用CentOS" } | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | Fedora **Fedora** | `fedora` `fedora-archive` | + | CentOS **CentOS** | `centos` `centos-stream` `centos-altarch` `centos-vault` | + | Rocky Linux **Rocky Linux** | `rocky` | + | AlmaLinux **AlmaLinux** | `almalinux` `almalinux-vault` | + | Oracle Linux **Oracle Linux** | `centos-stream` | + | openEuler **openEuler** | `openeuler` | + | OpenCloudOS **OpenCloudOS** | `opencloudos` | + | openKylin **openKylin** | `openkylin` | + | Anolis OS **Anolis OS** | `anolis` | + | openSUSE **openSUSE** | `opensuse` | + | Arch Linux **Arch Linux** | `archlinux` `archlinuxarm` | + | Manjaro **Manjaro** | `manjaro` | + | Alpine Linux **Alpine Linux** | `alpine` | + | Gentoo **Gentoo** | `gentoo` `gentoo-portage` | + | NixOS **NixOS** | `nix-channels` | 請看下面的例子 diff --git a/locales/docker/en.sh b/locales/docker/en.sh index b19a8e5..967888e 100644 --- a/locales/docker/en.sh +++ b/locales/docker/en.sh @@ -27,7 +27,7 @@ MESSAGE_CONTENTS=( ['error.unknownArch']='Unknown system architecture: {}' ['error.unsupportS390x']='Please refer to RHEL distribution announcement for s390x support' ['error.input']='Input error, {}!' - ['error.needRoot']='Insufficient permissions, please run this script as Root user' + ['error.needRoot']='Insufficient privileges, please run this script as root. Switch command: {}' ['error.sync']='{} failed. Please fix system software sources (package repositories) so the {} package manager is available!' ['error.downloadGPG']='GPG key download failed, please check network or switch Docker CE mirror and retry!' ['error.queryVersionFailed']='Failed to query Docker Engine version list!' diff --git a/locales/docker/zh-hans.sh b/locales/docker/zh-hans.sh index d08b49c..c83f8d8 100644 --- a/locales/docker/zh-hans.sh +++ b/locales/docker/zh-hans.sh @@ -27,7 +27,7 @@ MESSAGE_CONTENTS=( ['error.unknownArch']='未知的系统架构:{}' ['error.unsupportS390x']='请查阅 RHEL 发行版声明以了解 s390x 支持' ['error.input']='输入错误,{}!' - ['error.needRoot']='权限不足,请使用 Root 用户运行本脚本' + ['error.needRoot']='权限不足,请切换至 root 账户后运行本脚本,切换命令 {}' ['error.sync']='{}出错,请先解决系统原有软件源错误以确保 {} 软件包管理工具可用!' ['error.downloadGPG']='GPG 密钥下载失败,请检查网络或更换 Docker CE 软件源后重试!' ['error.queryVersionFailed']='查询 Docker Engine 版本列表失败!' diff --git a/locales/docker/zh-hant.sh b/locales/docker/zh-hant.sh index 1e494d5..22d5697 100644 --- a/locales/docker/zh-hant.sh +++ b/locales/docker/zh-hant.sh @@ -27,7 +27,7 @@ MESSAGE_CONTENTS=( ['error.unknownArch']='未知的系統架構:{}' ['error.unsupportS390x']='請查閱 RHEL 發行版宣告以瞭解 s390x 支援' ['error.input']='輸入錯誤,{}!' - ['error.needRoot']='權限不足,請使用 Root 使用者執行本腳本' + ['error.needRoot']='權限不足,請切換至 root 帳戶後執行本腳本,切換指令 {}' ['error.sync']='{}出錯,請先解決系統原有軟體源錯誤以確保 {} 軟體包管理工具可用!' ['error.downloadGPG']='GPG 金鑰下載失敗,請檢查網路或更換 Docker CE 軟體源後重試!' ['error.queryVersionFailed']='查詢 Docker Engine 版本清單失敗!' diff --git a/locales/linux/en.sh b/locales/linux/en.sh index 6ff4e45..038eaca 100644 --- a/locales/linux/en.sh +++ b/locales/linux/en.sh @@ -24,7 +24,7 @@ MESSAGE_CONTENTS=( ['error.unknownSystem']='Unknown system' ['error.unknownVersion']='System version unknown' ['error.input']='Input error, {}!' - ['error.needRoot']='Insufficient permissions, please run this script as Root user' + ['error.needRoot']='Insufficient privileges, please run this script as root. Switch command: {}' ['error.defaultBehavior.https']='HTTPS is used by default' ['error.defaultBehavior.noReplace']='No replacement by default' ['error.defaultBehavior.noOverwrite']='No overwrite by default' diff --git a/locales/linux/zh-hans.sh b/locales/linux/zh-hans.sh index 894e1ee..3777c92 100644 --- a/locales/linux/zh-hans.sh +++ b/locales/linux/zh-hans.sh @@ -24,7 +24,7 @@ MESSAGE_CONTENTS=( ['error.unknownSystem']='未知系统' ['error.unknownVersion']='系统版本未知' ['error.input']='输入错误,{}!' - ['error.needRoot']='权限不足,请使用 Root 用户运行本脚本' + ['error.needRoot']='权限不足,请切换至 root 账户后运行本脚本,切换命令 {}' ['error.defaultBehavior.https']='默认使用 HTTPS 协议' ['error.defaultBehavior.noReplace']='默认不更换' ['error.defaultBehavior.noOverwrite']='默认不覆盖' diff --git a/locales/linux/zh-hant.sh b/locales/linux/zh-hant.sh index e970865..84ba654 100644 --- a/locales/linux/zh-hant.sh +++ b/locales/linux/zh-hant.sh @@ -25,7 +25,7 @@ MESSAGE_CONTENTS=( ['error.unknownSystem']='未知系統' ['error.unknownVersion']='系統版本未知' ['error.input']='輸入錯誤,{}!' - ['error.needRoot']='權限不足,請使用 Root 使用者執行本腳本' + ['error.needRoot']='權限不足,請切換至 root 帳戶後執行本腳本,切換指令 {}' ['error.defaultBehavior.https']='預設使用 HTTPS 協定' ['error.defaultBehavior.noReplace']='預設不更換' ['error.defaultBehavior.noOverwrite']='預設不覆蓋'