From cdfccd09e8412509d4f902aceaf5476560ac305b Mon Sep 17 00:00:00 2001 From: SuperManito <68613938+SuperManito@users.noreply.github.com> Date: Mon, 8 May 2023 18:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=82=E9=85=8D=20OpenClou?= =?UTF-8?q?dOS=20&=20=E4=B8=80=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeMirrors.sh | 1052 +++--- ChangeMirrors_Edu.sh | 4221 ----------------------- README.md | 121 +- docs/assets/images/icon/opencloudos.png | Bin 0 -> 716 bytes docs/index.md | 14 +- docs/mirrors.md | 40 +- docs/other/index.md | 2 +- docs/use/command-options.md | 19 +- docs/use/index.md | 20 +- mkdocs.yml | 8 +- 10 files changed, 765 insertions(+), 4732 deletions(-) delete mode 100644 ChangeMirrors_Edu.sh create mode 100644 docs/assets/images/icon/opencloudos.png diff --git a/ChangeMirrors.sh b/ChangeMirrors.sh index b5adc5d..a617e1a 100644 --- a/ChangeMirrors.sh +++ b/ChangeMirrors.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Author: SuperManito -## Modified: 2023-05-07 +## Modified: 2023-05-08 ## License: MIT ## Github: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn @@ -97,6 +97,32 @@ mirror_list_abroad=( "非洲 · Liquid Telecom · 肯尼亚@mirror.liquidtelecom.com" "非洲 · Dimension Data · 南非@mirror.dimensiondata.com" ) +# 中国大陆教育网格式:"软件源名称@软件源地址" +mirror_list_edu=( + "ISCAS@mirror.iscas.ac.cn" + "清华大学@mirrors.tuna.tsinghua.edu.cn" + "北京大学@mirrors.pku.edu.cn" + "南京大学@mirrors.nju.edu.cn" + "重庆大学@mirrors.cqu.edu.cn" + "兰州大学@mirror.lzu.edu.cn" + "浙江大学@mirrors.zju.edu.cn" + "山东大学@mirrors.sdu.edu.cn" + "吉林大学@mirrors.jlu.edu.cn" + "上海交通大学@mirror.sjtu.edu.cn" + "上海科技大学@mirrors.shanghaitech.edu.cn" + "南方科技大学@mirrors.sustech.edu.cn" + "南京邮电大学@mirrors.njupt.edu.cn" + "电子科技大学@mirrors.uestc.cn" + "北京交通大学@mirror.bjtu.edu.cn" + "齐鲁工业大学@mirrors.qlu.edu.cn" + "南阳理工学院@mirror.nyist.edu.cn" + "武昌首义学院@mirrors.wsyu.edu.cn" + "哈尔滨工业大学@mirrors.hit.edu.cn" + "北京外国语大学@mirrors.bfsu.edu.cn" + "大连东软信息学院@mirrors.neusoft.edu.cn" + "西北农林科技大学@mirrors.nwafu.edu.cn" + "中国科学技术大学@mirrors.ustc.edu.cn" +) ## 配置需要区分公网地址和内网地址的软件源(不分地域) # 配置方法:需要同时在两个数组变量中分别定义软件源地址,并且保证排列顺序一致 @@ -125,7 +151,8 @@ SYSTEM_RHEL="Red Hat Enterprise Linux" SYSTEM_CENTOS="CentOS" SYSTEM_CENTOS_STREAM="CentOS Stream" SYSTEM_ROCKY="Rocky" -SYSTEM_ALMA="AlmaLinux" +SYSTEM_ALMALINUX="AlmaLinux" +SYSTEM_OPENCLOUDOS="OpenCloudOS" SYSTEM_FEDORA="Fedora" SYSTEM_OPENEULER="openEuler" SYSTEM_OPENSUSE="openSUSE" @@ -135,6 +162,7 @@ SYSTEM_ARCH="Arch" File_LinuxRelease=/etc/os-release File_RedHatRelease=/etc/redhat-release File_openEulerRelease=/etc/openEuler-release +File_OpenCloudOSRelease=/etc/opencloudos-release File_ArchRelease=/etc/arch-release File_DebianVersion=/etc/debian_version File_DebianSourceList=/etc/apt/sources.list @@ -143,10 +171,8 @@ Dir_DebianExtendSource=/etc/apt/sources.list.d Dir_DebianExtendSourceBackup=/etc/apt/sources.list.d.bak File_ArchMirrorList=/etc/pacman.d/mirrorlist File_ArchMirrorListBackup=/etc/pacman.d/mirrorlist.bak -Dir_RedHatRepos=/etc/yum.repos.d -Dir_RedHatReposBackup=/etc/yum.repos.d.bak -Dir_openEulerRepos=/etc/yum.repos.d -Dir_openEulerReposBackup=/etc/yum.repos.d.bak +Dir_YumRepos=/etc/yum.repos.d +Dir_YumReposBackup=/etc/yum.repos.d.bak Dir_openSUSERepos=/etc/zypp/repos.d Dir_openSUSEReposBackup=/etc/zypp/repos.d.bak @@ -163,9 +189,6 @@ WARN='[\033[33mWARN\033[0m]' ERROR='[\033[31mERROR\033[0m]' WORKING='[\033[34m*\033[0m]' -## 其它 -WEBSITE="https://linuxmirrors.cn" - function StartTitle() { [ -z "${SOURCE}" ] && clear echo -e ' +-----------------------------------+' @@ -194,7 +217,7 @@ function CheckCommandOptions() { "${SYSTEM_DEBIAN}") if [[ "${SYSTEM_JUDGMENT}" != "${SYSTEM_DEBIAN}" ]]; then if [[ "${SOURCE_SECURITY}" == "true" || "${SOURCE_BRANCH_SECURITY}" == "true" ]]; then - Output_Error "当前系统不支持使用 debian-security 仓库故无法使用相关参数,请确认后重试!" + Output_Error "当前系统不支持使用 security 仓库相关参数,请确认后重试!" fi fi if [[ "${INSTALL_EPEL}" == "true" || "${ONLY_EPEL}" == "true" ]]; then @@ -202,9 +225,9 @@ function CheckCommandOptions() { fi ;; "${SYSTEM_REDHAT}") - if [[ "${SYSTEM_JUDGMENT}" != "${SYSTEM_CENTOS}" && "${SYSTEM_JUDGMENT}" != "${SYSTEM_RHEL}" ]]; then + if [[ "${SYSTEM_JUDGMENT}" != "${SYSTEM_CENTOS}" && "${SYSTEM_JUDGMENT}" != "${SYSTEM_RHEL}" && "${SYSTEM_JUDGMENT}" != "${SYSTEM_ALMALINUX}" ]]; then if [[ "${SOURCE_VAULT}" == "true" || "${SOURCE_BRANCH_VAULT}" == "true" ]]; then - Output_Error "当前系统不支持使用 centos-vault 仓库故无法使用相关参数,请确认后重试!" + Output_Error "当前系统不支持使用 vault 仓库相关参数,请确认后重试!" fi fi case "${SYSTEM_JUDGMENT}" in @@ -215,40 +238,21 @@ function CheckCommandOptions() { ;; esac ;; - "${SYSTEM_OPENEULER}") + "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}" | "${SYSTEM_OPENSUSE}" | "${SYSTEM_ARCH}") if [[ "${SOURCE_SECURITY}" == "true" || "${SOURCE_BRANCH_SECURITY}" == "true" ]]; then - Output_Error "当前系统不支持使用 debian-security 仓库故无法使用相关参数,请确认后重试!" + Output_Error "当前系统不支持使用 security 仓库相关参数,请确认后重试!" fi if [[ "${SOURCE_VAULT}" == "true" || "${SOURCE_BRANCH_VAULT}" == "true" ]]; then - Output_Error "当前系统不支持使用 centos-vault 仓库故无法使用相关参数,请确认后重试!" - fi - if [[ "${INSTALL_EPEL}" == "true" || "${ONLY_EPEL}" == "true" ]]; then Output_Error "当前系统不支持安装 EPEL 附件软件包故无法使用相关参数,请确认后重试!" fi - ;; - "${SYSTEM_OPENSUSE}") - if [[ "${SOURCE_SECURITY}" == "true" || "${SOURCE_BRANCH_SECURITY}" == "true" ]]; then - Output_Error "当前系统不支持使用 debian-security 仓库故无法使用相关参数,请确认后重试!" - fi - if [[ "${SOURCE_VAULT}" == "true" || "${SOURCE_BRANCH_VAULT}" == "true" ]]; then - Output_Error "当前系统不支持使用 centos-vault 仓库故无法使用相关参数,请确认后重试!" - fi - if [[ "${INSTALL_EPEL}" == "true" || "${ONLY_EPEL}" == "true" ]]; then - Output_Error "当前系统不支持安装 EPEL 附件软件包故无法使用相关参数,请确认后重试!" - fi - ;; - "${SYSTEM_ARCH}") - if [[ "${SOURCE_SECURITY}" == "true" || "${SOURCE_BRANCH_SECURITY}" == "true" ]]; then - Output_Error "当前系统不支持使用 debian-security 仓库故无法使用相关参数,请确认后重试!" - fi - if [[ "${SOURCE_VAULT}" == "true" || "${SOURCE_BRANCH_VAULT}" == "true" ]]; then - Output_Error "当前系统不支持使用 centos-vault 仓库故无法使用相关参数,请确认后重试!" - fi if [[ "${INSTALL_EPEL}" == "true" || "${ONLY_EPEL}" == "true" ]]; then Output_Error "当前系统不支持安装 EPEL 附件软件包故无法使用相关参数,请确认后重试!" fi ;; esac + if [[ "${USE_ABROAD_SOURCE}" == "true" && "${USE_EDU_SOURCE}" == "true" ]]; then + Output_Error "两种模式不可同时使用!" + fi } ## 系统判定变量 @@ -261,17 +265,20 @@ function EnvJudgment() { SYSTEM_VERSION_NUMBER="$(cat $File_LinuxRelease | grep -E "^VERSION_ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g")" ## 定义系统ID SYSTEM_ID="$(cat $File_LinuxRelease | grep -E "^ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g")" - ## 判定当前系统派系(Debian/RedHat/openEuler/openSUSE) - if [ -s $File_RedHatRelease ]; then - SYSTEM_FACTIONS="${SYSTEM_REDHAT}" - elif [ -s $File_DebianVersion ]; then + ## 判定当前系统派系(Debian/RedHat/openEuler/OpenCloudOS/openSUSE) + if [ -s $File_DebianVersion ]; then SYSTEM_FACTIONS="${SYSTEM_DEBIAN}" + elif [ -s $File_OpenCloudOSRelease ]; then + # OpenCloudOS 判断优先级需要高于 RedHat,因为8版本基于红帽而9版本不是,为了方便保证脚本逻辑性,所以将其判断放在前面并作为独立的派系 + SYSTEM_FACTIONS="${SYSTEM_OPENCLOUDOS}" elif [ -s $File_openEulerRelease ]; then SYSTEM_FACTIONS="${SYSTEM_OPENEULER}" - elif [ -f $File_ArchRelease ]; then - SYSTEM_FACTIONS="${SYSTEM_ARCH}" elif [[ "${SYSTEM_NAME}" == *"openSUSE"* ]]; then SYSTEM_FACTIONS="${SYSTEM_OPENSUSE}" + elif [ -f $File_ArchRelease ]; then + SYSTEM_FACTIONS="${SYSTEM_ARCH}" + elif [ -s $File_RedHatRelease ]; then + SYSTEM_FACTIONS="${SYSTEM_REDHAT}" else Output_Error "无法判断当前运行环境,当前系统不在本脚本的支持范围内" fi @@ -296,6 +303,9 @@ function EnvJudgment() { cat $File_RedHatRelease | grep -q "${SYSTEM_CENTOS_STREAM}" [ $? -eq 0 ] && SYSTEM_JUDGMENT="${SYSTEM_CENTOS_STREAM}" ;; + "${SYSTEM_OPENCLOUDOS}") + SYSTEM_JUDGMENT="${SYSTEM_OPENCLOUDOS}" + ;; "${SYSTEM_OPENEULER}") SYSTEM_JUDGMENT="$(cat $File_openEulerRelease | awk -F ' ' '{printf$1}')" ;; @@ -328,7 +338,7 @@ function EnvJudgment() { Output_Error "当前系统版本不在本脚本的支持范围内" fi ;; - "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMA}") + "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_OPENCLOUDOS}") if [[ "${SYSTEM_VERSION_NUMBER:0:1}" != [8-9] ]]; then Output_Error "当前系统版本不在本脚本的支持范围内" fi @@ -489,7 +499,6 @@ function ChooseMirrors() { for ((j = 1; j <= ${tmp_spaces_nums}; j++)); do tmp_mirror_name="${tmp_mirror_name} " done - printf " ❖ %-$(($default_mirror_name_length + ${tmp_mirror_name_length}))s %4s\n" "${tmp_mirror_name}" "$arr_num)" done else @@ -497,7 +506,6 @@ function ChooseMirrors() { tmp_mirror_name=$(echo "${list_arr[i]}" | awk -F '@' '{print$1}') # 软件源名称 tmp_mirror_url=$(echo "${list_arr[i]}" | awk -F '@' '{print$2}') # 软件源地址 arr_num=$((i + 1)) - echo -e " ❖ $arr_num. ${tmp_mirror_url} | ${tmp_mirror_name}" done fi @@ -555,6 +563,9 @@ function ChooseMirrors() { if [[ ${USE_ABROAD_SOURCE} = "true" ]]; then local mirror_list_name="mirror_list_abroad" PrintMirrorsList "${mirror_list_name}" 60 + elif [[ ${USE_EDU_SOURCE} = "true" ]]; then + local mirror_list_name="mirror_list_edu" + PrintMirrorsList "${mirror_list_name}" 31 else local mirror_list_name="mirror_list_default" PrintMirrorsList "${mirror_list_name}" 31 @@ -621,17 +632,17 @@ function ChooseInstallEPEL() { rpm -qa | grep epel-release -q VERIFICATION_EPEL=$? ## 判断 /etc/yum.repos.d 目录下是否存在 epel 附加软件包 repo 源文件 - [ -d $Dir_RedHatRepos ] && ls $Dir_RedHatRepos | grep epel -q + [ -d $Dir_YumRepos ] && ls $Dir_YumRepos | grep epel -q VERIFICATION_EPELFILES=$? ## 判断 /etc/yum.repos.d.bak 目录下是否存在 epel 附加软件包 repo 源文件 - [ -d $Dir_RedHatReposBackup ] && ls $Dir_RedHatReposBackup | grep epel -q + [ -d $Dir_YumReposBackup ] && ls $Dir_YumReposBackup | grep epel -q VERIFICATION_EPELBACKUPFILES=$? } if [[ "${SYSTEM_FACTIONS}" == "${SYSTEM_REDHAT}" ]]; then if [[ -z "${INSTALL_EPEL}" ]]; then case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_RHEL}" | "${SYSTEM_CENTOS}" | "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMA}") + "${SYSTEM_RHEL}" | "${SYSTEM_CENTOS}" | "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_OPENCLOUDOS}") Check if [ ${VERIFICATION_EPEL} -eq 0 ]; then local CHOICE=$(echo -e "\n${BOLD}└─ 检测到系统已安装 EPEL 附加软件包,是否替换/覆盖软件源? [Y/n] ${PLAIN}") @@ -692,235 +703,100 @@ function CloseFirewall() { ## 备份原有软件源 function BackupOriginMirrors() { - BACKUPED="false" - if [[ "${BACKUP}" == "true" ]]; then + function BackupFile() { + local target_file=$1 + local backup_file=$2 + local type="$3" + + if [ -s $target_file ]; then + if [ -s $backup_file ]; then + if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then + local CHOICE_BACKUP1=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的${type}源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") + read -p "${CHOICE_BACKUP1}" INPUT + [[ -z "${INPUT}" ]] && INPUT=Y + case "${INPUT}" in + [Yy] | [Yy][Ee][Ss]) ;; + [Nn] | [Nn][Oo]) + echo '' + cp -rvf $target_file $backup_file 2>&1 + BACKUPED="true" + ;; + *) + echo -e "\n$WARN 输入错误,默认不覆盖!" + ;; + esac + fi + else + echo '' + cp -rvf $target_file $backup_file 2>&1 + BACKUPED="true" + echo -e "\n$COMPLETE 已备份原有${type}源文件" + sleep 1s + fi + else + [ ! -f $target_file ] && touch $target_file + echo -e '' + fi + } + function BackupRepo() { + local target_dir=$1 + local backup_dir=$2 local VERIFICATION_FILES=1 local VERIFICATION_BACKUPFILES=1 - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - ## 判断 /etc/apt/sources.list.d 目录下是否存在文件 - [ -d $Dir_DebianExtendSource ] && ls $Dir_DebianExtendSource | grep *.list -q - VERIFICATION_FILES=$? - ## 判断 /etc/apt/sources.list.d.bak 目录下是否存在文件 - [ -d $Dir_DebianExtendSourceBackup ] && ls $Dir_DebianExtendSourceBackup | grep *.list -q - VERIFICATION_BACKUPFILES=$? - ;; - "${SYSTEM_REDHAT}") - ## 判断 /etc/yum.repos.d 目录下是否存在文件 - [ -d $Dir_RedHatRepos ] && ls $Dir_RedHatRepos | grep '\.repo$' -q - VERIFICATION_FILES=$? - ## 判断 /etc/yum.repos.d.bak 目录下是否存在文件 - [ -d $Dir_RedHatReposBackup ] && ls $Dir_RedHatReposBackup | grep '\.repo$' -q - VERIFICATION_BACKUPFILES=$? - ;; - "${SYSTEM_OPENEULER}") - ## 判断 /etc/yum.repos.d 目录下是否存在文件 - [ -d $Dir_openEulerRepos ] && ls $Dir_openEulerRepos | grep '\.repo$' -q - VERIFICATION_FILES=$? - ## 判断 /etc/yum.repos.d.bak 目录下是否存在文件 - [ -d $Dir_openEulerReposBackup ] && ls $Dir_openEulerReposBackup | grep '\.repo$' -q - VERIFICATION_BACKUPFILES=$? - ;; - "${SYSTEM_OPENSUSE}") - ## 判断 /etc/zypp/repos.d 目录下是否存在文件 - [ -d $Dir_openSUSERepos ] && ls $Dir_openSUSERepos | grep '\.repo$' -q - VERIFICATION_FILES=$? - ## 判断 /etc/zypp/repos.d.bak 目录下是否存在文件 - [ -d $Dir_openSUSEReposBackup ] && ls $Dir_openSUSEReposBackup | grep '\.repo$' -q - VERIFICATION_BACKUPFILES=$? - ;; - esac + [ -d $target_dir ] && ls $target_dir | grep '\.repo$' -q + VERIFICATION_FILES=$? + [ -d $backup_dir ] && ls $backup_dir | grep '\.repo$' -q + VERIFICATION_BACKUPFILES=$? + if [ ${VERIFICATION_FILES} -eq 0 ]; then + if [ -d $backup_dir ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then + if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then + local CHOICE_BACKUP3=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 repo 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") + read -p "${CHOICE_BACKUP3}" INPUT + [[ -z "${INPUT}" ]] && INPUT=Y + case "${INPUT}" in + [Yy] | [Yy][Ee][Ss]) ;; + [Nn] | [Nn][Oo]) + echo '' + cp -rvf $target_dir/* $backup_dir 2>&1 + BACKUPED="true" + ;; + *) + echo -e "\n$WARN 输入错误,默认不覆盖!" + ;; + esac + fi + else + [ ! -d $backup_dir ] && mkdir -p $backup_dir + echo '' + cp -rvf $target_dir/* $backup_dir 2>&1 + BACKUPED="true" + echo -e "\n$COMPLETE 已备份原有 repo 源文件" + sleep 1s + fi + else + [ -d $target_dir ] || mkdir -p $target_dir + fi + } + BACKUPED="false" + if [[ "${BACKUP}" == "true" ]]; then case "${SYSTEM_FACTIONS}" in "${SYSTEM_DEBIAN}") ## /etc/apt/sources.list - if [ -s $File_DebianSourceList ]; then - if [ -s $File_DebianSourceListBackup ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP1=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 list 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP1}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $File_DebianSourceList $File_DebianSourceListBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - echo '' - cp -rvf $File_DebianSourceList $File_DebianSourceListBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 list 源文件" - sleep 1s - fi - else - [ ! -f $File_DebianSourceList ] && touch $File_DebianSourceList - echo -e '' - fi - - ## /etc/apt/sources.list.d - if [ -d $Dir_DebianExtendSource ] && [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_DebianExtendSourceBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP2=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 list 扩展源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP2}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_DebianExtendSource/* $Dir_DebianExtendSourceBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_DebianExtendSourceBackup ] && mkdir -p $Dir_DebianExtendSourceBackup - echo '' - cp -rvf $Dir_DebianExtendSource/* $Dir_DebianExtendSourceBackup 2>&1 - BACKUPED="true" - echo -e "$COMPLETE 已备份原有 list 扩展源文件" - sleep 1s - fi - fi + BackupFile $File_DebianSourceList $File_DebianSourceListBackup " list " ;; - "${SYSTEM_REDHAT}") + "${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}") ## /etc/yum.repos.d - if [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_RedHatReposBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP3=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 repo 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP3}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_RedHatRepos/* $Dir_RedHatReposBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_RedHatReposBackup ] && mkdir -p $Dir_RedHatReposBackup - echo '' - cp -rvf $Dir_RedHatRepos/* $Dir_RedHatReposBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 repo 源文件" - sleep 1s - fi - else - [ -d $Dir_RedHatRepos ] || mkdir -p $Dir_RedHatRepos - fi - ;; - "${SYSTEM_OPENEULER}") - ## /etc/yum.repos.d - if [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_openEulerReposBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP4=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 repo 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP4}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_openEulerRepos/* $Dir_openEulerReposBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_openEulerReposBackup ] && mkdir -p $Dir_openEulerReposBackup - echo '' - cp -rvf $Dir_openEulerRepos/* $Dir_openEulerReposBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 repo 源文件" - sleep 1s - fi - else - [ -d $Dir_openEulerRepos ] || mkdir -p $Dir_openEulerRepos - fi + BackupRepo $Dir_YumRepos $Dir_YumReposBackup ;; "${SYSTEM_OPENSUSE}") ## /etc/zypp/repos.d - if [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_openSUSEReposBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP4=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 repo 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP4}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_openSUSERepos/* $Dir_openSUSEReposBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_openSUSEReposBackup ] && mkdir -p $Dir_openSUSEReposBackup - echo '' - cp -rvf $Dir_openSUSERepos/* $Dir_openSUSEReposBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 repo 源文件" - sleep 1s - fi - else - [ -d $Dir_openSUSERepos ] || mkdir -p $Dir_openSUSERepos - fi + BackupRepo $Dir_openSUSERepos $Dir_openSUSEReposBackup ;; "${SYSTEM_ARCH}") ## /etc/pacman.d/mirrorlist - if [ -s $File_ArchMirrorList ]; then - if [ -s $File_ArchMirrorListBackup ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP5=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的软件源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP5}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $File_ArchMirrorList $File_ArchMirrorListBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - echo '' - cp -rvf $File_ArchMirrorList $File_ArchMirrorListBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有软件源文件" - sleep 1s - fi - else - [ ! -f $File_ArchMirrorList ] && touch $File_ArchMirrorList - echo -e '' - fi + BackupFile $File_ArchMirrorList $File_ArchMirrorListBackup " mirrorlist " ;; esac fi @@ -933,26 +809,69 @@ function RemoveOriginMirrors() { [ -f $File_DebianSourceList ] && sed -i '1,$d' $File_DebianSourceList ;; "${SYSTEM_REDHAT}") - if [ -d $Dir_RedHatRepos ]; then - # Fedora Linux 特殊,只删除以 fedora 开头的文件 + if [ -d $Dir_YumRepos ]; then case "${SYSTEM_JUDGMENT}" in "${SYSTEM_FEDORA}") - rm -rf $Dir_RedHatRepos/fedora* + rm -rf $Dir_YumRepos/fedora* ;; *) if [[ "${ONLY_EPEL}" == "false" ]]; then - if [ -f $Dir_RedHatRepos/epel.repo ]; then - ls $Dir_RedHatRepos/ | egrep -v epel | xargs rm -rf - else - rm -rf $Dir_RedHatRepos/* - fi + case "${SYSTEM_JUDGMENT}" in + "${SYSTEM_RHEL}") + case ${SYSTEM_VERSION_NUMBER:0:1} in + 9) + rm -rf $Dir_YumRepos/rocky* + ;; + *) + if [ -f $Dir_YumRepos/epel.repo ]; then + ls $Dir_YumRepos/ | egrep -v epel | xargs rm -rf + else + rm -rf $Dir_YumRepos/* + fi + ;; + esac + ;; + "${SYSTEM_CENTOS}") + if [ -f $Dir_YumRepos/epel.repo ]; then + ls $Dir_YumRepos/ | egrep -v epel | xargs rm -rf + else + rm -rf $Dir_YumRepos/* + fi + ;; + "${SYSTEM_CENTOS_STREAM}") + case ${SYSTEM_VERSION_NUMBER:0:1} in + 9) + rm -rf $Dir_YumRepos/centos* + ;; + 8) + rm -rf $Dir_YumRepos/CentOS-Stream-* + ;; + esac + ;; + "${SYSTEM_ROCKY}") + case ${SYSTEM_VERSION_NUMBER:0:1} in + 9) + rm -rf $Dir_YumRepos/rocky* + ;; + 8) + rm -rf $Dir_YumRepos/Rocky-* + ;; + esac + ;; + "${SYSTEM_ALMALINUX}") + rm -rf $Dir_YumRepos/almalinux* + ;; + esac fi ;; esac fi ;; + "${SYSTEM_OPENCLOUDOS}") + [ -d $Dir_YumRepos ] && rm -rf $Dir_YumRepos/OpenCloudOS* + ;; "${SYSTEM_OPENEULER}") - [ -d $Dir_openEulerRepos ] && rm -rf $Dir_openEulerRepos/* + [ -d $Dir_YumRepos ] && rm -rf $Dir_YumRepos/openEuler.repo ;; "${SYSTEM_OPENSUSE}") [ -d $Dir_openSUSERepos ] && rm -rf $Dir_openSUSERepos/repo-* @@ -999,11 +918,8 @@ function ChangeMirrors() { "${SYSTEM_DEBIAN}") DiffMode1 $File_DebianSourceListBackup $File_DebianSourceList ;; - "${SYSTEM_REDHAT}") - DiffMode2 $Dir_RedHatReposBackup $Dir_RedHatRepos - ;; - "${SYSTEM_OPENEULER}") - DiffMode2 $Dir_openEulerReposBackup $Dir_openEulerRepos + "${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}") + DiffMode2 $Dir_YumReposBackup $Dir_YumRepos ;; "${SYSTEM_OPENSUSE}") DiffMode2 $Dir_openSUSEReposBackup $Dir_openSUSERepos @@ -1023,6 +939,9 @@ function ChangeMirrors() { "${SYSTEM_REDHAT}") RedHatMirrors ;; + "${SYSTEM_OPENCLOUDOS}") + OpenCloudOSMirrors + ;; "${SYSTEM_OPENEULER}") openEulerMirrors ;; @@ -1039,7 +958,7 @@ function ChangeMirrors() { "${SYSTEM_DEBIAN}") apt-get update ;; - "${SYSTEM_REDHAT}" | "${SYSTEM_OPENEULER}") + "${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}") yum makecache ;; "${SYSTEM_OPENSUSE}") @@ -1069,7 +988,7 @@ function UpdateSoftware() { "${SYSTEM_DEBIAN}") apt-get upgrade -y ;; - "${SYSTEM_REDHAT}" | "${SYSTEM_OPENEULER}") + "${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}") yum update -y --skip-broken ;; "${SYSTEM_OPENSUSE}") @@ -1083,7 +1002,7 @@ function UpdateSoftware() { apt-get autoremove -y >/dev/null 2>&1 apt-get clean >/dev/null 2>&1 ;; - "${SYSTEM_REDHAT}" | "${SYSTEM_OPENEULER}") + "${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}") yum autoremove -y >/dev/null 2>&1 yum clean packages -y >/dev/null 2>&1 ;; @@ -1127,8 +1046,9 @@ function UpdateSoftware() { esac } + ## Arch Linux 和 Red Hat Enterprise Linux 系统不更新软件包 case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}" | "${SYSTEM_REDHAT}" | "${SYSTEM_OPENEULER}" | "${SYSTEM_OPENSUSE}") + "${SYSTEM_DEBIAN}" | "${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}" | "${SYSTEM_OPENSUSE}") if [[ "${SYSTEM_JUDGMENT}" != "${SYSTEM_RHEL}" ]]; then if [[ "${UPDATA_SOFTWARE}" == "true" ]]; then Main @@ -1147,7 +1067,8 @@ function UpdateSoftware() { ## 运行结束 function RunEnd() { - echo -e "\n$COMPLETE 脚本执行结束 [\033[1;34m官网\033[0m] ${WEBSITE}\n" + echo -e "\n$COMPLETE 脚本执行结束" + echo -e "\n\033[1;34mPowered by linuxmirrors.cn\033[0m\n" } ############################################################################## @@ -1223,28 +1144,28 @@ function RedHatMirrors() { yum install -y https://mirrors.cloud.tencent.com/epel/epel-release-latest-${SYSTEM_VERSION_NUMBER:0:1}.noarch.rpm fi ## 删除原有 repo 源文件 - [ ${VERIFICATION_EPELFILES} -eq 0 ] && rm -rf $Dir_RedHatRepos/epel* - [ ${VERIFICATION_EPELBACKUPFILES} -eq 0 ] && rm -rf $Dir_RedHatReposBackup/epel* + [ ${VERIFICATION_EPELFILES} -eq 0 ] && rm -rf $Dir_YumRepos/epel* + [ ${VERIFICATION_EPELBACKUPFILES} -eq 0 ] && rm -rf $Dir_YumReposBackup/epel* ## 生成 repo 源文件 GenRepoFiles_EPEL # 更换 WEB 协议(HTTP/HTTPS) case ${SYSTEM_VERSION_NUMBER:0:1} in 9 | 8) - sed -i "s|^#baseurl=https|baseurl=${WEB_PROTOCOL}|g" $Dir_RedHatRepos/epel* + sed -i "s|^#baseurl=https|baseurl=${WEB_PROTOCOL}|g" $Dir_YumRepos/epel* ;; 7) - sed -i "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" $Dir_RedHatRepos/epel* + sed -i "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" $Dir_YumRepos/epel* ;; esac # 修改源 - sed -i 's|^metalink=|#metalink=|g' $Dir_RedHatRepos/epel* + sed -i 's|^metalink=|#metalink=|g' $Dir_YumRepos/epel* case ${SYSTEM_VERSION_NUMBER:0:1} in 9) - sed -i "s|download.example/pub|${SOURCE}|g" $Dir_RedHatRepos/epel* + sed -i "s|download.example/pub|${SOURCE}|g" $Dir_YumRepos/epel* ;; 8 | 7) - sed -i "s|download.fedoraproject.org/pub|${SOURCE}|g" $Dir_RedHatRepos/epel* + sed -i "s|download.fedoraproject.org/pub|${SOURCE}|g" $Dir_YumRepos/epel* ;; esac } @@ -1274,7 +1195,7 @@ function RedHatMirrors() { "${SYSTEM_ROCKY}") GenRepoFiles_RockyLinux ${SYSTEM_VERSION_NUMBER:0:1} ;; - "${SYSTEM_ALMA}") + "${SYSTEM_ALMALINUX}") GenRepoFiles_AlmaLinux ${SYSTEM_VERSION_NUMBER:0:1} ;; "${SYSTEM_FEDORA}") @@ -1283,7 +1204,7 @@ function RedHatMirrors() { esac ## 修改源 - cd $Dir_RedHatRepos + cd $Dir_YumRepos case "${SYSTEM_JUDGMENT}" in "${SYSTEM_RHEL}") case ${SYSTEM_VERSION_NUMBER:0:1} in @@ -1309,13 +1230,13 @@ function RedHatMirrors() { sed -i 's|mirror.centos.org/$contentdir|mirror.centos.org/centos-vault|g' CentOS-* sed -i "s/\$releasever/8.5.2111/g" CentOS-* # 单独处理 CentOS-Linux-Sources.repo - sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos-vault"}|g" CentOS-Linux-Sources.repo + sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_BRANCH_VAULT:-"centos-vault"}|g" CentOS-Linux-Sources.repo ;; 7) sed -i "s|mirror.centos.org/\$contentdir|mirror.centos.org/${SOURCE_BRANCH}|g" CentOS-* sed -i "s/\$releasever/7/g" CentOS-* # 单独处理 CentOS-Sources.repo - sed -i "s|vault.centos.org/centos|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos"}|g" CentOS-Sources.repo + sed -i "s|vault.centos.org/centos|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_BRANCH_VAULT:-"${SOURCE_BRANCH}"}|g" CentOS-Sources.repo ;; esac sed -i "s|mirror.centos.org|${SOURCE}|g" CentOS-* @@ -1332,11 +1253,11 @@ function RedHatMirrors() { sed -i 's|mirror.centos.org/$contentdir|mirror.centos.org/centos-vault|g' CentOS-* sed -i "s/\$releasever/8.5.2111/g" CentOS-* # 单独处理 CentOS-Linux-Sources.repo - sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos-vault"}|g" CentOS-Linux-Sources.repo + sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_BRANCH_VAULT:-"centos-vault"}|g" CentOS-Linux-Sources.repo ;; 7) sed -i "s|mirror.centos.org/\$contentdir|mirror.centos.org/${SOURCE_BRANCH}|g" CentOS-* - sed -i "s|vault.centos.org/centos|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos"}|g" CentOS-Sources.repo # 单独处理 CentOS-Sources.repo + sed -i "s|vault.centos.org/centos|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_BRANCH_VAULT:-"${SOURCE_BRANCH}"}|g" CentOS-Sources.repo # 单独处理 CentOS-Sources.repo ;; esac sed -i "s|mirror.centos.org|${SOURCE}|g" CentOS-* @@ -1353,7 +1274,7 @@ function RedHatMirrors() { centos-addons.repo ;; 8) - sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos"}|g" CentOS-Stream-Sources.repo # 单独处理 CentOS-Stream-Sources.repo + sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_BRANCH_VAULT:-"${SOURCE_BRANCH}"}|g" CentOS-Stream-Sources.repo # 单独处理 CentOS-Stream-Sources.repo sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ -e "s|^mirrorlist=|#mirrorlist=|g" \ -e "s|mirror.centos.org/\$contentdir|${SOURCE}/${SOURCE_BRANCH}|g" \ @@ -1383,21 +1304,21 @@ function RedHatMirrors() { ;; esac ;; - "${SYSTEM_ALMA}") + "${SYSTEM_ALMALINUX}") case ${SYSTEM_VERSION_NUMBER:0:1} in 9) sed -e "s|^# baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ -e "s|^mirrorlist=|#mirrorlist=|g" \ + -e "s|repo.almalinux.org/vault|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_BRANCH_VAULT:-"almalinux-vault"}|g" \ -e "s|repo.almalinux.org/almalinux|${SOURCE}/${SOURCE_BRANCH}|g" \ - -e "s|repo.almalinux.org/vault|${SOURCE}/${SOURCE_BRANCH}-vault|g" \ -i \ almalinux-* ;; 8) sed -e "s|^mirrorlist=|#mirrorlist=|g" \ -e "s|^# baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ + -e "s|repo.almalinux.org/vault|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_BRANCH_VAULT:-"almalinux-vault"}|g" \ -e "s|repo.almalinux.org/almalinux|${SOURCE}/${SOURCE_BRANCH}|g" \ - -e "s|repo.almalinux.org/vault|${SOURCE}/${SOURCE_BRANCH}-vault|g" \ -i \ almalinux-ha.repo \ almalinux-nfv.repo \ @@ -1427,16 +1348,39 @@ function RedHatMirrors() { ## EPEL 附加软件包(安装/换源) case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_RHEL}" | "${SYSTEM_CENTOS}" | "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMA}") + "${SYSTEM_RHEL}" | "${SYSTEM_CENTOS}" | "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}") [[ "${INSTALL_EPEL}" == "True" ]] && EPELMirrors ;; esac } +## 更换基于 OpenCloudOS 发行版的软件源 +function OpenCloudOSMirrors() { + GenRepoFiles_OpenCloudOS ${SYSTEM_VERSION_NUMBER:0:1} + cd $Dir_YumRepos + + case ${SYSTEM_VERSION_NUMBER:0:1} in + 9) + sed -e "s|^baseurl=https|baseurl=${WEB_PROTOCOL}|g" \ + -e "s|mirrors.opencloudos.tech/opencloudos|${SOURCE}/${SOURCE_BRANCH}|g" \ + -i \ + OpenCloudOS.repo + ;; + 8) + sed -e "s|^baseurl=https|baseurl=${WEB_PROTOCOL}|g" \ + -e "s|mirrors.opencloudos.tech/opencloudos|${SOURCE}/${SOURCE_BRANCH}|g" \ + -i \ + OpenCloudOS-Debuginfo.repo \ + OpenCloudOS.repo \ + OpenCloudOS-Sources.repo + ;; + esac +} + ## 更换基于 openEuler 发行版的软件源 function openEulerMirrors() { GenRepoFiles_openEuler - cd $Dir_openEulerRepos + cd $Dir_YumRepos sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ -e "s|repo.openeuler.org|${SOURCE}/${SOURCE_BRANCH}|g" \ @@ -1524,7 +1468,7 @@ function ArchMirrors() { function GenRepoFiles_CentOS() { case $1 in 8) - cat >$Dir_RedHatRepos/CentOS-Linux-AppStream.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-AppStream.repo <<\EOF # CentOS-Linux-AppStream.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1543,7 +1487,7 @@ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-BaseOS.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-BaseOS.repo <<\EOF # CentOS-Linux-BaseOS.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1562,7 +1506,7 @@ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-ContinuousRelease.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-ContinuousRelease.repo <<\EOF # CentOS-Linux-ContinuousRelease.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1588,7 +1532,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Debuginfo.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-Debuginfo.repo <<\EOF # CentOS-Linux-Debuginfo.repo # # All debug packages are merged into a single repo, split by basearch, and are @@ -1601,7 +1545,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Devel.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-Devel.repo <<\EOF # CentOS-Linux-Devel.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1620,7 +1564,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Extras.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-Extras.repo <<\EOF # CentOS-Linux-Extras.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1639,7 +1583,7 @@ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-FastTrack.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-FastTrack.repo <<\EOF # CentOS-Linux-FastTrack.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1658,7 +1602,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-HighAvailability.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-HighAvailability.repo <<\EOF # CentOS-Linux-HighAvailability.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1677,7 +1621,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Media.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-Media.repo <<\EOF # CentOS-Linux-Media.repo # # You can use this repo to install items directly off the installation media. @@ -1701,7 +1645,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Plus.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-Plus.repo <<\EOF # CentOS-Linux-Plus.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1720,7 +1664,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-PowerTools.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-PowerTools.repo <<\EOF # CentOS-Linux-PowerTools.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -1739,7 +1683,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Sources.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Linux-Sources.repo <<\EOF # CentOS-Linux-Sources.repo @@ -1773,7 +1717,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF ;; 7) - cat >$Dir_RedHatRepos/CentOS-Base.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Base.repo <<\EOF # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the @@ -1818,7 +1762,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 EOF - cat >$Dir_RedHatRepos/CentOS-CR.repo <<\EOF + cat >$Dir_YumRepos/CentOS-CR.repo <<\EOF # CentOS-CR.repo # # The Continuous Release ( CR ) repository contains rpms that are due in the next @@ -1848,7 +1792,7 @@ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 enabled=0 EOF - cat >$Dir_RedHatRepos/CentOS-Debuginfo.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Debuginfo.repo <<\EOF # CentOS-Debug.repo # # The mirror system uses the connecting IP address of the client and the @@ -1871,7 +1815,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7 enabled=0 # EOF - cat >$Dir_RedHatRepos/CentOS-fasttrack.repo <<\EOF + cat >$Dir_YumRepos/CentOS-fasttrack.repo <<\EOF [fasttrack] name=CentOS-7 - fasttrack mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=fasttrack&infra=$infra @@ -1880,7 +1824,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 EOF - cat >$Dir_RedHatRepos/CentOS-Media.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Media.repo <<\EOF # CentOS-Media.repo # # This repo can be used with mounted DVD media, verify the mount point for @@ -1903,7 +1847,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 EOF - cat >$Dir_RedHatRepos/CentOS-Sources.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Sources.repo <<\EOF # CentOS-Sources.repo # # The mirror system uses the connecting IP address of the client and the @@ -1955,7 +1899,7 @@ EOF function GenRepoFiles_CentOSStream() { case $1 in 9) - cat >$Dir_RedHatRepos/centos.repo <<\EOF + cat >$Dir_YumRepos/centos.repo <<\EOF [baseos] name=CentOS Stream $releasever - BaseOS #baseurl=https://mirror.stream.centos.org/$releasever-stream/BaseOS/$basearch/os/ @@ -2043,7 +1987,7 @@ repo_gpgcheck=0 metadata_expire=6h enabled=0 EOF - cat >$Dir_RedHatRepos/centos-addons.repo <<\EOF + cat >$Dir_YumRepos/centos-addons.repo <<\EOF [highavailability] name=CentOS Stream $releasever - HighAvailability #baseurl=https://mirror.stream.centos.org/$releasever-stream/HighAvailability/$basearch/os/ @@ -2182,7 +2126,7 @@ enabled=0 EOF ;; 8) - cat >$Dir_RedHatRepos/CentOS-Stream-AppStream.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-AppStream.repo <<\EOF # CentOS-Stream-AppStream.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2201,7 +2145,7 @@ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-BaseOS.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-BaseOS.repo <<\EOF # CentOS-Stream-BaseOS.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2220,7 +2164,7 @@ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Debuginfo.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-Debuginfo.repo <<\EOF # CentOS-Stream-Debuginfo.repo # # All debug packages are merged into a single repo, split by basearch, and are @@ -2233,7 +2177,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Extras-common.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-Extras-common.repo <<\EOF # CentOS-Stream-Extras-common.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2252,7 +2196,7 @@ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Extras.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-Extras.repo <<\EOF # CentOS-Stream-Extras.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2271,7 +2215,7 @@ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-HighAvailability.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-HighAvailability.repo <<\EOF # CentOS-Stream-HighAvailability.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2290,7 +2234,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Media.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-Media.repo <<\EOF # CentOS-Stream-Media.repo # # You can use this repo to install items directly off the installation media. @@ -2314,7 +2258,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-NFV.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-NFV.repo <<\EOF # CentOS-Stream-NFV.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2333,7 +2277,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-PowerTools.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-PowerTools.repo <<\EOF # CentOS-Stream-PowerTools.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2352,7 +2296,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-RealTime.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-RealTime.repo <<\EOF # CentOS-Stream-RealTime.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2371,7 +2315,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-ResilientStorage.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-ResilientStorage.repo <<\EOF # CentOS-Stream-ResilientStorage.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2390,7 +2334,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Sources.repo <<\EOF + cat >$Dir_YumRepos/CentOS-Stream-Sources.repo <<\EOF # CentOS-Stream-Sources.repo [baseos-source] @@ -2457,7 +2401,7 @@ EOF function GenRepoFiles_RockyLinux() { case $1 in 9) - cat >$Dir_RedHatRepos/rocky.repo <<\EOF + cat >$Dir_YumRepos/rocky.repo <<\EOF # rocky.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2552,7 +2496,7 @@ enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 EOF - cat >$Dir_RedHatRepos/rocky-addons.repo <<\EOF + cat >$Dir_YumRepos/rocky-addons.repo <<\EOF # rocky-addons.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2731,7 +2675,7 @@ enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 EOF - cat >$Dir_RedHatRepos/rocky-devel.repo <<\EOF + cat >$Dir_YumRepos/rocky-devel.repo <<\EOF # rocky-devel.repo # # devel and no-package-left-behind @@ -2745,7 +2689,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 EOF - cat >$Dir_RedHatRepos/rocky-extras.repo <<\EOF + cat >$Dir_YumRepos/rocky-extras.repo <<\EOF # rocky-extras.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2814,7 +2758,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 EOF ;; 8) - cat >$Dir_RedHatRepos/Rocky-AppStream.repo <<\EOF + cat >$Dir_YumRepos/Rocky-AppStream.repo <<\EOF # Rocky-AppStream.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2834,7 +2778,7 @@ enabled=1 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-BaseOS.repo <<\EOF + cat >$Dir_YumRepos/Rocky-BaseOS.repo <<\EOF # Rocky-BaseOS.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2854,7 +2798,7 @@ enabled=1 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-Debuginfo.repo <<\EOF + cat >$Dir_YumRepos/Rocky-Debuginfo.repo <<\EOF # Rocky-Debuginfo.repo # @@ -2898,7 +2842,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-Devel.repo <<\EOF + cat >$Dir_YumRepos/Rocky-Devel.repo <<\EOF # Rocky-Devel.repo # @@ -2911,7 +2855,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-Extras.repo <<\EOF + cat >$Dir_YumRepos/Rocky-Extras.repo <<\EOF # Rocky-Extras.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2931,7 +2875,7 @@ enabled=1 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-HighAvailability.repo <<\EOF + cat >$Dir_YumRepos/Rocky-HighAvailability.repo <<\EOF # Rocky-HighAvailability.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2951,7 +2895,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-Media.repo <<\EOF + cat >$Dir_YumRepos/Rocky-Media.repo <<\EOF # Rocky-Media.repo # # You can use this repo to install items directly off the installation media. @@ -2975,7 +2919,7 @@ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-NFV.repo <<\EOF + cat >$Dir_YumRepos/Rocky-NFV.repo <<\EOF # Rocky-NFV.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -2995,7 +2939,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-Plus.repo <<\EOF + cat >$Dir_YumRepos/Rocky-Plus.repo <<\EOF # Rocky-Plus.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -3015,7 +2959,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-PowerTools.repo <<\EOF + cat >$Dir_YumRepos/Rocky-PowerTools.repo <<\EOF # Rocky-PowerTools.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -3035,7 +2979,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-ResilientStorage.repo <<\EOF + cat >$Dir_YumRepos/Rocky-ResilientStorage.repo <<\EOF # Rocky-ResilientStorage.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -3055,7 +2999,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-RT.repo <<\EOF + cat >$Dir_YumRepos/Rocky-RT.repo <<\EOF # Rocky-RT.repo # # The mirrorlist system uses the connecting IP address of the client and the @@ -3075,7 +3019,7 @@ enabled=0 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial EOF - cat >$Dir_RedHatRepos/Rocky-Sources.repo <<\EOF + cat >$Dir_YumRepos/Rocky-Sources.repo <<\EOF # Rocky-Sources.repo [baseos-source] @@ -3142,7 +3086,7 @@ EOF function GenRepoFiles_AlmaLinux() { case $1 in 9) - cat >$Dir_RedHatRepos/almalinux-appstream.repo <<\EOF + cat >$Dir_YumRepos/almalinux-appstream.repo <<\EOF [appstream] name=AlmaLinux $releasever - AppStream mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream @@ -3174,7 +3118,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-baseos.repo <<\EOF + cat >$Dir_YumRepos/almalinux-baseos.repo <<\EOF [baseos] name=AlmaLinux $releasever - BaseOS mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos @@ -3206,7 +3150,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-crb.repo <<\EOF + cat >$Dir_YumRepos/almalinux-crb.repo <<\EOF [crb] name=AlmaLinux $releasever - CRB mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/crb @@ -3238,7 +3182,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-extras.repo <<\EOF + cat >$Dir_YumRepos/almalinux-extras.repo <<\EOF [extras] name=AlmaLinux $releasever - Extras mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras @@ -3270,7 +3214,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-highavailability.repo <<\EOF + cat >$Dir_YumRepos/almalinux-highavailability.repo <<\EOF [highavailability] name=AlmaLinux $releasever - HighAvailability mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability @@ -3302,7 +3246,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-nfv.repo <<\EOF + cat >$Dir_YumRepos/almalinux-nfv.repo <<\EOF [nfv] name=AlmaLinux $releasever - NFV mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv @@ -3334,7 +3278,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-plus.repo <<\EOF + cat >$Dir_YumRepos/almalinux-plus.repo <<\EOF [plus] name=AlmaLinux $releasever - Plus mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus @@ -3366,7 +3310,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-resilientstorage.repo <<\EOF + cat >$Dir_YumRepos/almalinux-resilientstorage.repo <<\EOF [resilientstorage] name=AlmaLinux $releasever - ResilientStorage mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage @@ -3398,7 +3342,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-rt.repo <<\EOF + cat >$Dir_YumRepos/almalinux-rt.repo <<\EOF [rt] name=AlmaLinux $releasever - RT mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt @@ -3430,7 +3374,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-sap.repo <<\EOF + cat >$Dir_YumRepos/almalinux-sap.repo <<\EOF [sap] name=AlmaLinux $releasever - SAP mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap @@ -3462,7 +3406,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 metadata_expire=86400 enabled_metadata=0 EOF - cat >$Dir_RedHatRepos/almalinux-saphana.repo <<\EOF + cat >$Dir_YumRepos/almalinux-saphana.repo <<\EOF [saphana] name=AlmaLinux $releasever - SAPHANA mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana @@ -3496,7 +3440,7 @@ enabled_metadata=0 EOF ;; 8) - cat >$Dir_RedHatRepos/almalinux-ha.repo <<\EOF + cat >$Dir_YumRepos/almalinux-ha.repo <<\EOF # almalinux-ha.repo [ha] @@ -3526,7 +3470,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux-nfv.repo <<\EOF + cat >$Dir_YumRepos/almalinux-nfv.repo <<\EOF # almalinux-nfv.repo [nfv] @@ -3555,7 +3499,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux-plus.repo <<\EOF + cat >$Dir_YumRepos/almalinux-plus.repo <<\EOF # almalinux-plus.repo [plus] @@ -3585,7 +3529,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux-powertools.repo <<\EOF + cat >$Dir_YumRepos/almalinux-powertools.repo <<\EOF # almalinux-powertools.repo [powertools] @@ -3615,7 +3559,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux-resilientstorage.repo <<\EOF + cat >$Dir_YumRepos/almalinux-resilientstorage.repo <<\EOF # almalinux-resilientstorage.repo [resilientstorage] @@ -3645,7 +3589,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux-rt.repo <<\EOF + cat >$Dir_YumRepos/almalinux-rt.repo <<\EOF # almalinux-rt.repo [rt] @@ -3674,7 +3618,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux-sap.repo <<\EOF + cat >$Dir_YumRepos/almalinux-sap.repo <<\EOF # almalinux-sap.repo [sap] @@ -3704,7 +3648,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux-saphana.repo <<\EOF + cat >$Dir_YumRepos/almalinux-saphana.repo <<\EOF # almalinux-saphana.repo [saphana] @@ -3734,7 +3678,7 @@ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux EOF - cat >$Dir_RedHatRepos/almalinux.repo <<\EOF + cat >$Dir_YumRepos/almalinux.repo <<\EOF # almalinux.repo [baseos] @@ -3820,7 +3764,7 @@ EOF ## 生成 Fedora 官方 repo 源文件 function GenRepoFiles_Fedora() { - cat >$Dir_RedHatRepos/fedora-cisco-openh264.repo <<\EOF + cat >$Dir_YumRepos/fedora-cisco-openh264.repo <<\EOF [fedora-cisco-openh264] name=Fedora $releasever openh264 (From Cisco) - $basearch metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-$releasever&arch=$basearch @@ -3843,7 +3787,7 @@ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=True EOF - cat >$Dir_RedHatRepos/fedora.repo <<\EOF + cat >$Dir_YumRepos/fedora.repo <<\EOF [fedora] name=Fedora $releasever - $basearch #baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ @@ -3881,7 +3825,7 @@ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False EOF - cat >$Dir_RedHatRepos/fedora-updates.repo <<\EOF + cat >$Dir_YumRepos/fedora-updates.repo <<\EOF [updates] name=Fedora $releasever - $basearch - Updates #baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/$basearch/ @@ -3919,7 +3863,7 @@ metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False EOF - cat >$Dir_RedHatRepos/fedora-modular.repo <<\EOF + cat >$Dir_YumRepos/fedora-modular.repo <<\EOF [fedora-modular] name=Fedora Modular $releasever - $basearch #baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Modular/$basearch/os/ @@ -3957,7 +3901,7 @@ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False EOF - cat >$Dir_RedHatRepos/fedora-updates-modular.repo <<\EOF + cat >$Dir_YumRepos/fedora-updates-modular.repo <<\EOF [updates-modular] name=Fedora Modular $releasever - $basearch - Updates #baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Modular/$basearch/ @@ -3995,7 +3939,7 @@ metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False EOF - cat >$Dir_RedHatRepos/fedora-updates-testing.repo <<\EOF + cat >$Dir_YumRepos/fedora-updates-testing.repo <<\EOF [updates-testing] name=Fedora $releasever - $basearch - Test Updates #baseurl=http://download.example/pub/fedora/linux/updates/testing/$releasever/Everything/$basearch/ @@ -4033,7 +3977,7 @@ metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False EOF - cat >$Dir_RedHatRepos/fedora-updates-testing-modular.repo <<\EOF + cat >$Dir_YumRepos/fedora-updates-testing-modular.repo <<\EOF [updates-testing-modular] name=Fedora Modular $releasever - $basearch - Test Updates #baseurl=http://download.example/pub/fedora/linux/updates/testing/$releasever/Modular/$basearch/ @@ -4073,6 +4017,304 @@ skip_if_unavailable=False EOF } +## 生成 OpenCloudOS 官方 repo 源文件 +function GenRepoFiles_OpenCloudOS() { + case $1 in + 9) + cat >$Dir_YumRepos/OpenCloudOS.repo <<\EOF +[BaseOS] +name=BaseOS $releasever - $basearch +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/BaseOS/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[AppStream] +name=AppStream $releasever - $basearch +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/AppStream/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[extras] +name=extras $releasever - $basearch +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/extras/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[BaseOS-debug] +name=BaseOS-debug $releasever - $basearch +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/BaseOS/$basearch/debug/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[AppStream-debug] +name=AppStream-debug $releasever - $basearch +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/AppStream/$basearch/debug/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[extras-debug] +name=extras-debug $releasever - $basearch +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/extras/$basearch/debug/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[BaseOS-source] +name=BaseOS-source $releasever +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/BaseOS/source/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[AppStream-source] +name=AppStream-source $releasever +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/AppStream/source/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 + +[extras-source] +name=extras-source $releasever +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/extras/source/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS-9 +EOF + ;; + 8) + cat >$Dir_YumRepos/OpenCloudOS-Debuginfo.repo <<\EOF +# OpenCloudOS-Debuginfo.repo +# +# Author: OpenCloudOS +# +[BaseOS-debuginfo] +name=OpenCloudOS $releasever - BaseOS-debuginfo +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/BaseOS/$basearch/debug/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[AppStream-debuginfo] +name=OpenCloudOS $releasever - AppStream-debuginfo +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/AppStream/$basearch/debug/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[Extras-debuginfo] +name=OpenCloudOS $releasever - Extras-debuginfo +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/Extras/$basearch/debug/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[HighAvailability-debuginfo] +name=OpenCloudOS $releasever - HighAvailability-debuginfo +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/HighAvailability/$basearch/debug/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[PowerTools-debuginfo] +name=OpenCloudOS $releasever - PowerTools-debuginfo +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/PowerTools/$basearch/debug/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[ResilientStorage-debuginfo] +name=OpenCloudOS $releasever - ResilientStorage-debuginfo +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/ResilientStorage/$basearch/debug/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[Plus-debuginfo] +name=OpenCloudOS $releasever - Plus-debuginfo +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/Plus/$basearch/debug/tree/ +gpgcheck=1 +enabled=0 +EOF + cat >$Dir_YumRepos/OpenCloudOS.repo <<\EOF +# OpenCloudOS.repo +# +# Author: OpenCloudOS +# +[BaseOS] +name=OpenCloudOS $releasever - BaseOS +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/BaseOS/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[AppStream] +name=OpenCloudOS $releasever - AppStream +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/AppStream/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[Extras] +name=OpenCloudOS $releasever - Extras +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/Extras/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[HighAvailability] +name=OpenCloudOS $releasever - HighAvailability +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/HighAvailability/$basearch/os/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[PowerTools] +name=OpenCloudOS $releasever - PowerTools +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/PowerTools/$basearch/os/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[ResilientStorage] +name=OpenCloudOS $releasever - ResilientStorage +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/ResilientStorage/$basearch/os/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[Plus] +name=OpenCloudOS $releasever - Plus +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/Plus/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS +EOF + cat >$Dir_YumRepos/OpenCloudOS-Sources.repo <<\EOF +# OpenCloudOS-Sources.repo +# +# Author: OpenCloudOS +# +[BaseOS-source] +name=OpenCloudOS $releasever - Base-source +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/BaseOS/source/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[AppStream-source] +name=OpenCloudOS $releasever - AppStream-source +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/AppStream/source/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[Extras-source] +name=OpenCloudOS $releasever - Extras-source +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/Extras/source/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[HighAvailability-source] +name=OpenCloudOS $releasever - HighAvailability-source +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/HighAvailability/source/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[PowerTools-source] +name=OpenCloudOS $releasever - PowerTools-source +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/PowerTools/source/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[ResilientStorage-source] +name=OpenCloudOS $releasever - ResilientStorage-source +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/ResilientStorage/source/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS + +[Plus-source] +name=OpenCloudOS $releasever - Plus-source +baseurl=https://mirrors.opencloudos.tech/opencloudos/$releasever/Plus/source/tree/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OpenCloudOS +EOF + ;; + esac +} + +## 生成 openEuler 官方 repo 源文件 +function GenRepoFiles_openEuler() { + cat >$Dir_YumRepos/openEuler.repo <<\EOF +#generic-repos is licensed under the Mulan PSL v2. +#You can use this software according to the terms and conditions of the Mulan PSL v2. +#You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +#PURPOSE. +#See the Mulan PSL v2 for more details. + +[OS] +name=OS +baseurl=http://repo.openeuler.org/openEuler-$releasever/OS/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-$releasever/OS/$basearch/RPM-GPG-KEY-openEuler + +[everything] +name=everything +baseurl=http://repo.openeuler.org/openEuler-$releasever/everything/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-$releasever/everything/$basearch/RPM-GPG-KEY-openEuler + +[EPOL] +name=EPOL +baseurl=http://repo.openeuler.org/openEuler-$releasever/EPOL/main/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-$releasever/OS/$basearch/RPM-GPG-KEY-openEuler + +[debuginfo] +name=debuginfo +baseurl=http://repo.openeuler.org/openEuler-$releasever/debuginfo/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-$releasever/debuginfo/$basearch/RPM-GPG-KEY-openEuler + +[source] +name=source +baseurl=http://repo.openeuler.org/openEuler-$releasever/source/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-$releasever/source/RPM-GPG-KEY-openEuler + +[update] +name=update +baseurl=http://repo.openeuler.org/openEuler-$releasever/update/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-$releasever/OS/$basearch/RPM-GPG-KEY-openEuler + +[update-source] +name=update-source +baseurl=http://repo.openeuler.org/openEuler-$releasever/update/source/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-$releasever/source/RPM-GPG-KEY-openEuler +EOF +} + ## 生成 openSUSE 官方 repo 源文件 function GenRepoFiles_openSUSE() { case $1 in @@ -4356,7 +4598,7 @@ EOF function GenRepoFiles_EPEL() { case ${SYSTEM_VERSION_NUMBER:0:1} in 9) - cat >$Dir_RedHatRepos/epel.repo <<\EOF + cat >$Dir_YumRepos/epel.repo <<\EOF [epel] name=Extra Packages for Enterprise Linux $releasever - $basearch # It is much more secure to use the metalink, but if you wish to use a local mirror @@ -4388,7 +4630,7 @@ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever gpgcheck=1 EOF - cat >$Dir_RedHatRepos/epel-testing.repo <<\EOF + cat >$Dir_YumRepos/epel-testing.repo <<\EOF [epel-testing] name=Extra Packages for Enterprise Linux $releasever - Testing - $basearch # It is much more secure to use the metalink, but if you wish to use a local mirror @@ -4422,7 +4664,7 @@ gpgcheck=1 EOF ;; 8) - cat >$Dir_RedHatRepos/epel.repo <<\EOF + cat >$Dir_YumRepos/epel.repo <<\EOF [epel] name=Extra Packages for Enterprise Linux $releasever - $basearch #baseurl=https://download.fedoraproject.org/pub/epel/8/Everything/$basearch @@ -4447,7 +4689,7 @@ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 EOF - cat >$Dir_RedHatRepos/epel-modular.repo <<\EOF + cat >$Dir_YumRepos/epel-modular.repo <<\EOF [epel-modular] name=Extra Packages for Enterprise Linux Modular $releasever - $basearch #baseurl=https://download.fedoraproject.org/pub/epel/8/Modular/$basearch @@ -4472,7 +4714,7 @@ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 EOF - cat >$Dir_RedHatRepos/epel-playground.repo <<\EOF + cat >$Dir_YumRepos/epel-playground.repo <<\EOF [epel-playground] name=Extra Packages for Enterprise Linux $releasever - Playground - $basearch #baseurl=https://download.fedoraproject.org/pub/epel/playground/$releasever/Everything/$basearch/os @@ -4497,7 +4739,7 @@ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 EOF - cat >$Dir_RedHatRepos/epel-testing.repo <<\EOF + cat >$Dir_YumRepos/epel-testing.repo <<\EOF [epel-testing] name=Extra Packages for Enterprise Linux $releasever - Testing - $basearch #baseurl=https://download.fedoraproject.org/pub/epel/testing/$releasever/Everything/$basearch @@ -4522,7 +4764,7 @@ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 EOF - cat >$Dir_RedHatRepos/epel-testing-modular.repo <<\EOF + cat >$Dir_YumRepos/epel-testing-modular.repo <<\EOF [epel-testing-modular] name=Extra Packages for Enterprise Linux Modular $releasever - Testing - $basearch #baseurl=https://download.fedoraproject.org/pub/epel/testing/$releasever/Modular/$basearch @@ -4549,7 +4791,7 @@ gpgcheck=1 EOF ;; 7) - cat >$Dir_RedHatRepos/epel.repo <<\EOF + cat >$Dir_YumRepos/epel.repo <<\EOF [epel] name=Extra Packages for Enterprise Linux 7 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch @@ -4577,7 +4819,7 @@ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 EOF - cat >$Dir_RedHatRepos/epel-testing.repo <<\EOF + cat >$Dir_YumRepos/epel-testing.repo <<\EOF [epel-testing] name=Extra Packages for Enterprise Linux 7 - Testing - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch @@ -4616,23 +4858,24 @@ function CommandOptions() { echo -e " 选项命令(参数名/含义/参数值): - --source 指定软件源地址 地址 - --source-security 指定 debian-security 软件源地址 地址 - --source-vault 指定 centos-vault 软件源地址 地址 - --branch 指定软件源分支(路径) 分支名 - --branch-security 指定 debian-security 软件源分支(路径) 分支名 - --branch-vault 指定 centos-vault 软件源分支(路径) 分支名 - --abroad 使用海外软件源 无 - --web-protocol 指定 WEB 协议 http 或 https - --intranet 优先使用内网地址 true 或 false - --install-epel 安装 EPEL 附加软件包 true 或 false - --only-epel 仅更换 EPEL 软件源模式 无 - --close-firewall 关闭防火墙 true 或 false - --backup 备份原有软件源 true 或 false - --ignore-backup-tips 忽略覆盖备份提示 无 - --updata-software 更新软件包 true 或 false - --clean-cache 清理下载缓存 true 或 false - --print-diff 打印源文件修改前后差异 无 + --source 指定软件源地址 地址 + --source-security 指定 debian 的 security 软件源地址 地址 + --source-vault 指定 centos/almalinux 的 vault 软件源地址 地址 + --branch 指定软件源分支(路径) 分支名 + --branch-security 指定 debian 的 security 软件源分支(路径) 分支名 + --branch-vault 指定 centos/almalinux 的 vault 软件源分支(路径) 分支名 + --abroad 使用海外软件源 无 + --edu 使用中国大陆教育网软件源 无 + --web-protocol 指定 WEB 协议 http 或 https + --intranet 优先使用内网地址 true 或 false + --install-epel 安装 EPEL 附加软件包 true 或 false + --only-epel 仅更换 EPEL 软件源模式 无 + --close-firewall 关闭防火墙 true 或 false + --backup 备份原有软件源 true 或 false + --ignore-backup-tips 忽略覆盖备份提示 无 + --updata-software 更新软件包 true 或 false + --clean-cache 清理下载缓存 true 或 false + --print-diff 打印源文件修改前后差异 无 问题报告 https://github.com/SuperManito/LinuxMirrors/issues " @@ -4645,6 +4888,10 @@ function CommandOptions() { --abroad) USE_ABROAD_SOURCE="true" ;; + ## 中国大陆教育网模式 + --edu) + USE_EDU_SOURCE="true" + ;; ## 指定软件源地址 --source) if [ $2 ]; then @@ -4834,6 +5081,7 @@ function CommandOptions() { --print-diff) PRINT_DIFF="true" ;; + ## 命令帮助 --help) Output_Help_Info exit diff --git a/ChangeMirrors_Edu.sh b/ChangeMirrors_Edu.sh deleted file mode 100644 index 63edd62..0000000 --- a/ChangeMirrors_Edu.sh +++ /dev/null @@ -1,4221 +0,0 @@ -#!/bin/bash -## Author: SuperManito -## Modified: 2023-05-07 -## License: MIT -## Github: https://github.com/SuperManito/LinuxMirrors -## Website: https://linuxmirrors.cn -## 中国大陆教育网专用版 - -## 指定软件源地址和分支(字符串) -SOURCE="" -SOURCE_BRANCH="" -## 指定 debian-security 软件源地址和分支(字符串) -SOURCE_SECURITY="" -SOURCE_BRANCH_SECURITY="" -## 指定 centos-vault 软件源地址和分支(字符串) -SOURCE_VAULT="" -SOURCE_BRANCH_VAULT="" -## WEB 协议(http/https) -WEB_PROTOCOL="" -## 备份原有软件源(true/false) -BACKUP="true" -## 忽略覆盖备份提示(true/false) -IGNORE_BACKUP_TIPS="false" -## 打印源文件修改前后差异(true/false) -PRINT_DIFF="true" - -## 软件源列表 -mirror_list_default=( - "清华大学@mirrors.tuna.tsinghua.edu.cn" - "北京交通大学@mirror.bjtu.edu.cn" - "北京外国语大学@mirrors.bfsu.edu.cn" - "齐鲁工业大学@mirrors.qlu.edu.cn" - "中国科学技术大学@mirrors.ustc.edu.cn" - "南京大学@mirrors.nju.edu.cn" - "上海交通大学@mirror.sjtu.edu.cn" - "吉林大学@mirrors.jlu.edu.cn" - "重庆大学@mirrors.cqu.edu.cn" - "哈尔滨工业大学@mirrors.hit.edu.cn" - "ISCAS@mirror.iscas.ac.cn" - "山东大学@mirrors.sdu.edu.cn" - "南方科技大学@mirrors.sustech.edu.cn" - "大连东软信息学院@mirrors.neusoft.edu.cn" - "兰州大学@mirror.lzu.edu.cn" - "南京邮电大学@mirrors.njupt.edu.cn" - "西北农林科技大学@mirrors.nwafu.edu.cn" - "南阳理工学院@mirror.nyist.edu.cn" - "北京大学@mirrors.pku.edu.cn" - "上海科技大学@mirrors.shanghaitech.edu.cn" - "电子科技大学@mirrors.uestc.cn" - "武昌首义学院@mirrors.wsyu.edu.cn" - "浙江大学@mirrors.zju.edu.cn" -) - -############################################################################## - -## 定义系统判定变量 -SYSTEM_DEBIAN="Debian" -SYSTEM_UBUNTU="Ubuntu" -SYSTEM_KALI="Kali" -SYSTEM_REDHAT="RedHat" -SYSTEM_RHEL="Red Hat Enterprise Linux" -SYSTEM_CENTOS="CentOS" -SYSTEM_CENTOS_STREAM="CentOS Stream" -SYSTEM_ROCKY="Rocky" -SYSTEM_ALMA="AlmaLinux" -SYSTEM_FEDORA="Fedora" -SYSTEM_OPENEULER="openEuler" -SYSTEM_OPENSUSE="openSUSE" -SYSTEM_ARCH="Arch" - -## 定义目录和文件 -File_LinuxRelease=/etc/os-release -File_RedHatRelease=/etc/redhat-release -File_openEulerRelease=/etc/openEuler-release -File_ArchRelease=/etc/arch-release -File_DebianVersion=/etc/debian_version -File_DebianSourceList=/etc/apt/sources.list -File_DebianSourceListBackup=/etc/apt/sources.list.bak -Dir_DebianExtendSource=/etc/apt/sources.list.d -Dir_DebianExtendSourceBackup=/etc/apt/sources.list.d.bak -File_ArchMirrorList=/etc/pacman.d/mirrorlist -File_ArchMirrorListBackup=/etc/pacman.d/mirrorlist.bak -Dir_RedHatRepos=/etc/yum.repos.d -Dir_RedHatReposBackup=/etc/yum.repos.d.bak -Dir_openEulerRepos=/etc/yum.repos.d -Dir_openEulerReposBackup=/etc/yum.repos.d.bak -Dir_openSUSERepos=/etc/zypp/repos.d -Dir_openSUSEReposBackup=/etc/zypp/repos.d.bak - -## 定义颜色变量 -RED='\033[31m' -GREEN='\033[32m' -YELLOW='\033[33m' -BLUE='\033[34m' -PLAIN='\033[0m' -BOLD='\033[1m' -SUCCESS='[\033[32m成功\033[0m]' -COMPLETE='[\033[32m完成\033[0m]' -WARN='[\033[33m警告\033[0m]' -ERROR='[\033[31m错误\033[0m]' -WORKING='[\033[34m*\033[0m]' - -function StartTitle() { - [ -z "${SOURCE}" ] && clear - echo -e ' +-----------------------------------+' - echo -e " | \033[0;1;35;95m⡇\033[0m \033[0;1;33;93m⠄\033[0m \033[0;1;32;92m⣀⡀\033[0m \033[0;1;36;96m⡀\033[0;1;34;94m⢀\033[0m \033[0;1;35;95m⡀⢀\033[0m \033[0;1;31;91m⡷\033[0;1;33;93m⢾\033[0m \033[0;1;32;92m⠄\033[0m \033[0;1;36;96m⡀⣀\033[0m \033[0;1;34;94m⡀\033[0;1;35;95m⣀\033[0m \033[0;1;31;91m⢀⡀\033[0m \033[0;1;33;93m⡀\033[0;1;32;92m⣀\033[0m \033[0;1;36;96m⢀⣀\033[0m |" - echo -e " | \033[0;1;31;91m⠧\033[0;1;33;93m⠤\033[0m \033[0;1;32;92m⠇\033[0m \033[0;1;36;96m⠇⠸\033[0m \033[0;1;34;94m⠣\033[0;1;35;95m⠼\033[0m \033[0;1;31;91m⠜⠣\033[0m \033[0;1;33;93m⠇\033[0;1;32;92m⠸\033[0m \033[0;1;36;96m⠇\033[0m \033[0;1;34;94m⠏\033[0m \033[0;1;35;95m⠏\033[0m \033[0;1;33;93m⠣⠜\033[0m \033[0;1;32;92m⠏\033[0m \033[0;1;34;94m⠭⠕\033[0m |" - echo -e ' +-----------------------------------+' - echo -e ' 欢迎使用 GNU/Linux 一键更换软件源脚本' - echo -e ' 中国大陆教育网专用版' -} - -## 报错退出 -function Output_Error() { - [ "$1" ] && echo -e "\n$ERROR $1\n" - exit 1 -} - -## 权限判定 -function PermissionJudgment() { - if [ $UID -ne 0 ]; then - Output_Error "权限不足,请使用 Root 用户运行本脚本" - fi -} - -## 换源前用户确认 -function UserConfirm() { - local TargetFiles i - ## Debian/Arch 获取模式 - function GetFileMode1() { - local file_tmp="$1" - [ -s "${file_tmp}" ] && TargetFiles="${file_tmp}" - } - ## RedHat/openEuler/openSUSE 获取模式 - function GetFileMode2() { - local dir_tmp="$1" - ls $dir_tmp | grep -Ev "epel|docker" | grep '\.repo$' -q - if [ $? -eq 0 ]; then - local tmp_arr=( - $(ls $dir_tmp | grep -Ev "epel|docker" | grep '\.repo$') - ) - for ((i = 0; i < ${#tmp_arr[@]}; i++)); do - if [[ "${TargetFiles}" ]]; then - TargetFiles="$TargetFiles\n$dir_tmp/${tmp_arr[$i]}" - else - TargetFiles="$dir_tmp/${tmp_arr[$i]}" - fi - done - fi - } - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - GetFileMode1 $File_DebianSourceList - ;; - "${SYSTEM_REDHAT}") - GetFileMode2 $Dir_RedHatRepos - ;; - "${SYSTEM_OPENEULER}") - GetFileMode2 $Dir_openEulerRepos - ;; - "${SYSTEM_OPENSUSE}") - GetFileMode2 $Dir_openSUSERepos - ;; - "${SYSTEM_ARCH}") - GetFileMode1 $File_ArchMirrorList - ;; - esac - if [[ ! -z "${TargetFiles}" ]]; then - echo -e "\n$WARN 在此之前,本脚本没有对你的系统进行任何更改,接下来可能会修改下列提到的文件\n" - echo -e "${BLUE}${TargetFiles}${PLAIN}" - echo -e "\n如果你想中断本脚本的运行请输入 \"${BLUE}n${PLAIN}\" 或直接键入 ${BLUE}Ctrl + C${PLAIN},否则请在接下来的提示中输入 \"${GREEN}Y${PLAIN}\" 以开始进行换源操作" - local CHOICE=$(echo -e "\n${BOLD}└─ 请阅读上方提示并选择是否允许本脚本修改系统文件 [Y/n]:${PLAIN}") - while true; do - read -p "${CHOICE}" INPUT - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) - break - ;; - [Nn] | [Nn][Oo]) - exit - ;; - *) - echo -e "\n$WARN 请输入 \"${BLUE}Y${PLAIN}\" 或 \"${BLUE}n${PLAIN}\" !" - ;; - esac - done - fi -} - -## 命令选项兼容性判断 -function CheckCommandOptions() { - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - if [[ "${SYSTEM_JUDGMENT}" != "${SYSTEM_DEBIAN}" ]]; then - if [[ "${SOURCE_SECURITY}" == "true" || "${SOURCE_BRANCH_SECURITY}" == "true" ]]; then - Output_Error "当前系统不支持使用 debian-security 仓库故无法使用相关参数,请确认后重试!" - fi - fi - ;; - "${SYSTEM_REDHAT}") - if [[ "${SYSTEM_JUDGMENT}" != "${SYSTEM_CENTOS}" && "${SYSTEM_JUDGMENT}" != "${SYSTEM_RHEL}" ]]; then - if [[ "${SOURCE_VAULT}" == "true" || "${SOURCE_BRANCH_VAULT}" == "true" ]]; then - Output_Error "当前系统不支持使用 centos-vault 仓库故无法使用相关参数,请确认后重试!" - fi - fi - ;; - "${SYSTEM_OPENEULER}" | "${SYSTEM_OPENSUSE}" | "${SYSTEM_ARCH}") - if [[ "${SOURCE_SECURITY}" == "true" || "${SOURCE_BRANCH_SECURITY}" == "true" ]]; then - Output_Error "当前系统不支持使用 debian-security 仓库故无法使用相关参数,请确认后重试!" - fi - if [[ "${SOURCE_VAULT}" == "true" || "${SOURCE_BRANCH_VAULT}" == "true" ]]; then - Output_Error "当前系统不支持使用 centos-vault 仓库故无法使用相关参数,请确认后重试!" - fi - ;; - esac -} - -## 系统判定变量 -function EnvJudgment() { - ## 定义系统名称 - SYSTEM_NAME="$(cat $File_LinuxRelease | grep -E "^NAME=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g")" - cat $File_LinuxRelease | grep "PRETTY_NAME=" -q - [ $? -eq 0 ] && SYSTEM_PRETTY_NAME="$(cat $File_LinuxRelease | grep -E "^PRETTY_NAME=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g")" - ## 定义系统版本号 - SYSTEM_VERSION_NUMBER="$(cat $File_LinuxRelease | grep -E "^VERSION_ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g")" - ## 定义系统ID - SYSTEM_ID="$(cat $File_LinuxRelease | grep -E "^ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g")" - ## 判定当前系统派系(Debian/RedHat/openEuler/openSUSE) - if [ -s $File_RedHatRelease ]; then - SYSTEM_FACTIONS="${SYSTEM_REDHAT}" - elif [ -s $File_DebianVersion ]; then - SYSTEM_FACTIONS="${SYSTEM_DEBIAN}" - elif [ -s $File_openEulerRelease ]; then - SYSTEM_FACTIONS="${SYSTEM_OPENEULER}" - elif [ -f $File_ArchRelease ]; then - SYSTEM_FACTIONS="${SYSTEM_ARCH}" - elif [[ "${SYSTEM_NAME}" == *"openSUSE"* ]]; then - SYSTEM_FACTIONS="${SYSTEM_OPENSUSE}" - else - Output_Error "无法判断当前运行环境,当前系统不在本脚本的支持范围内" - fi - ## 判定系统名称、版本、版本号 - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - if [ ! -x /usr/bin/lsb_release ]; then - apt-get install -y lsb-release - if [ $? -ne 0 ]; then - Output_Error "lsb-release 软件包安装失败\n 本脚本需要通过 lsb_release 指令判断系统类型,当前可能为精简安装的系统,因为正常情况下系统会自带该软件包,请自行安装后重新执行脚本!" - fi - fi - SYSTEM_JUDGMENT="$(lsb_release -is)" - SYSTEM_VERSION_CODENAME="$(lsb_release -cs)" - ;; - "${SYSTEM_REDHAT}") - SYSTEM_JUDGMENT="$(cat $File_RedHatRelease | awk -F ' ' '{printf$1}')" - ## Red Hat Enterprise Linux - cat $File_RedHatRelease | grep -q "${SYSTEM_RHEL}" - [ $? -eq 0 ] && SYSTEM_JUDGMENT="${SYSTEM_RHEL}" - ## CentOS Stream - cat $File_RedHatRelease | grep -q "${SYSTEM_CENTOS_STREAM}" - [ $? -eq 0 ] && SYSTEM_JUDGMENT="${SYSTEM_CENTOS_STREAM}" - ;; - "${SYSTEM_OPENEULER}") - SYSTEM_JUDGMENT="$(cat $File_openEulerRelease | awk -F ' ' '{printf$1}')" - ;; - "${SYSTEM_OPENSUSE}") - SYSTEM_JUDGMENT="${SYSTEM_OPENSUSE}" - ;; - "${SYSTEM_ARCH}") - SYSTEM_JUDGMENT="${SYSTEM_ARCH}" - ;; - esac - ## 判断系统是否在脚本支持范围内 - case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_DEBIAN}") - if [[ "${SYSTEM_VERSION_NUMBER:0:1}" != [8-9] && "${SYSTEM_VERSION_NUMBER:0:2}" != 1[0-2] ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - ;; - "${SYSTEM_UBUNTU}") - if [[ "${SYSTEM_VERSION_NUMBER:0:2}" != 1[4-9] && "${SYSTEM_VERSION_NUMBER:0:2}" != 2[0-3] ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - ;; - "${SYSTEM_RHEL}") - if [[ "${SYSTEM_VERSION_NUMBER:0:1}" != [7-9] ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - ;; - "${SYSTEM_CENTOS}") - if [[ "${SYSTEM_VERSION_NUMBER:0:1}" != [7-8] ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - ;; - "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMA}") - if [[ "${SYSTEM_VERSION_NUMBER:0:1}" != [8-9] ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - ;; - "${SYSTEM_FEDORA}") - if [[ "${SYSTEM_VERSION_NUMBER:0:2}" != 3[0-8] ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - ;; - "${SYSTEM_OPENEULER}") - if [[ "${SYSTEM_VERSION_NUMBER:0:2}" != 2[1-3] ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - ;; - "${SYSTEM_OPENSUSE}") - if [[ "${SYSTEM_ID}" != "opensuse-leap" && "${SYSTEM_ID}" != "opensuse-tumbleweed" ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - else - if [[ "${SYSTEM_VERSION_NUMBER:0:2}" != 15 ]]; then - Output_Error "当前系统版本不在本脚本的支持范围内" - fi - fi - ;; - "${SYSTEM_KALI}" | "${SYSTEM_ARCH}") - # 理论全部支持 - ;; - *) - Output_Error "当前系统不在本脚本的支持范围内" - ;; - esac - ## 判定系统处理器架构 - case "$(uname -m)" in - x86_64) - DEVICE_ARCH="x86_64" - ;; - aarch64) - DEVICE_ARCH="ARM64" - ;; - armv7l) - DEVICE_ARCH="ARMv7" - ;; - armv6l) - DEVICE_ARCH="ARMv6" - ;; - i686) - DEVICE_ARCH="x86_32" - ;; - *) - DEVICE_ARCH="$(uname -m)" - ;; - esac - ## 定义软件源分支名称 - if [[ -z "${SOURCE_BRANCH}" ]]; then - ## 默认 - SOURCE_BRANCH="$(echo "${SYSTEM_JUDGMENT,,}" | sed "s/ /-/g")" - ## 处理特殊 - case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_DEBIAN}") - case ${SYSTEM_VERSION_NUMBER:0:1} in - 8 | 9) - SOURCE_BRANCH="debian-archive" - ;; - *) - SOURCE_BRANCH="debian" - ;; - esac - ;; - "${SYSTEM_RHEL}") - case ${SYSTEM_VERSION_NUMBER:0:1} in - 9) - SOURCE_BRANCH="rocky" - ;; - *) - SOURCE_BRANCH="centos" - ;; - esac - ;; - "${SYSTEM_CENTOS}") - if [[ "${DEVICE_ARCH}" == "x86_64" ]]; then - SOURCE_BRANCH="centos" - else - SOURCE_BRANCH="centos-altarch" - fi - ;; - "${SYSTEM_CENTOS_STREAM}") - case ${SYSTEM_VERSION_NUMBER:0:1} in - 8) - if [[ "${DEVICE_ARCH}" == "x86_64" ]]; then - SOURCE_BRANCH="centos" - else - SOURCE_BRANCH="centos-altarch" - fi - ;; - *) - SOURCE_BRANCH="centos-stream" - ;; - esac - ;; - "${SYSTEM_UBUNTU}") - if [[ "${DEVICE_ARCH}" == "x86_64" ]] || [[ "${DEVICE_ARCH}" == *i?86* ]]; then - SOURCE_BRANCH="ubuntu" - else - SOURCE_BRANCH="ubuntu-ports" - fi - ;; - "${SYSTEM_ARCH}") - if [[ "${DEVICE_ARCH}" == "x86_64" ]] || [[ "${DEVICE_ARCH}" == *i?86* ]]; then - SOURCE_BRANCH="archlinux" - else - SOURCE_BRANCH="archlinuxarm" - fi - ;; - esac - fi - ## 定义软件源同步/更新文字 - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - SYNC_TXT="更新" - ;; - *) - SYNC_TXT="同步" - ;; - esac -} - -## 选择软件源 -function ChooseMirrors() { - ## 打印软件源列表 - function PrintMirrorsList() { - local tmp_mirror_name tmp_mirror_url arr_num default_mirror_name_length tmp_mirror_name_length tmp_spaces_nums a i j - ## 计算字符串长度 - function StringLength() { - local text=$1 - echo "${#text}" - } - echo -e '' - - local list_arr=() - local list_arr_sum="$(eval echo \${#$1[@]})" - for ((a = 0; a < $list_arr_sum; a++)); do - list_arr[$a]="$(eval echo \${$1[a]})" - done - if [ -x /usr/bin/printf ]; then - for ((i = 0; i < ${#list_arr[@]}; i++)); do - tmp_mirror_name=$(echo "${list_arr[i]}" | awk -F '@' '{print$1}') # 软件源名称 - # tmp_mirror_url=$(echo "${list_arr[i]}" | awk -F '@' '{print$2}') # 软件源地址 - arr_num=$((i + 1)) - default_mirror_name_length=${2:-"30"} # 默认软件源名称打印长度 - ## 补齐长度差异(中文的引号在等宽字体中占1格而非2格) - [[ $(echo "${tmp_mirror_name}" | grep -c "“") -gt 0 ]] && let default_mirror_name_length+=$(echo "${tmp_mirror_name}" | grep -c "“") - [[ $(echo "${tmp_mirror_name}" | grep -c "”") -gt 0 ]] && let default_mirror_name_length+=$(echo "${tmp_mirror_name}" | grep -c "”") - [[ $(echo "${tmp_mirror_name}" | grep -c "‘") -gt 0 ]] && let default_mirror_name_length+=$(echo "${tmp_mirror_name}" | grep -c "‘") - [[ $(echo "${tmp_mirror_name}" | grep -c "’") -gt 0 ]] && let default_mirror_name_length+=$(echo "${tmp_mirror_name}" | grep -c "’") - # 非一般字符长度 - tmp_mirror_name_length=$(StringLength $(echo "${tmp_mirror_name}" | sed "s| ||g" | sed "s|[0-9a-zA-Z\.\=\:\_\(\)\'\"-\/\!·]||g;")) - ## 填充空格 - tmp_spaces_nums=$(($(($default_mirror_name_length - ${tmp_mirror_name_length} - $(StringLength "${tmp_mirror_name}"))) / 2)) - for ((j = 1; j <= ${tmp_spaces_nums}; j++)); do - tmp_mirror_name="${tmp_mirror_name} " - done - - printf " ❖ %-$(($default_mirror_name_length + ${tmp_mirror_name_length}))s %4s\n" "${tmp_mirror_name}" "$arr_num)" - done - else - for ((i = 0; i < ${#list_arr[@]}; i++)); do - tmp_mirror_name=$(echo "${list_arr[i]}" | awk -F '@' '{print$1}') # 软件源名称 - tmp_mirror_url=$(echo "${list_arr[i]}" | awk -F '@' '{print$2}') # 软件源地址 - arr_num=$((i + 1)) - - echo -e " ❖ $arr_num. ${tmp_mirror_url} | ${tmp_mirror_name}" - done - fi - } - - function Title() { - local system_name="${SYSTEM_PRETTY_NAME:-"${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER}"}" - local arch=""${DEVICE_ARCH}"" - local date="$(date "+%Y-%m-%d %H:%M:%S")" - local timezone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')" - - echo -e '' - echo -e " 运行环境 ${BLUE}${system_name} ${arch}${PLAIN}" - echo -e " 系统时间 ${BLUE}${date} ${timezone}${PLAIN}" - local CHOICE=$(echo -e "\n${BOLD}└─ 请确认脚本检测到的系统及版本与实际无误 [Y/n]:${PLAIN}") - while true; do - read -p "${CHOICE}" INPUT - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) - break - ;; - [Nn] | [Nn][Oo]) - exit - ;; - *) - echo -e "\n$WARN 请输入 \"${BLUE}Y${PLAIN}\" 或 \"${BLUE}n${PLAIN}\" !" - ;; - esac - done - } - - Title - if [[ -z "${SOURCE}" ]]; then - local mirror_list_name="mirror_list_default" - PrintMirrorsList "${mirror_list_name}" 31 - - local CHOICE=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的软件源 [ 1-$(eval echo \${#$mirror_list_name[@]}) ]:${PLAIN}") - while true; do - read -p "${CHOICE}" INPUT - case "${INPUT}" in - [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) - local tmp_source="$(eval echo \${${mirror_list_name}[$(($INPUT - 1))]})" - if [[ -z "${tmp_source}" ]]; then - echo -e "\n$WARN 请输入有效的数字序号!" - else - SOURCE="$(eval echo \${${mirror_list_name}[$(($INPUT - 1))]} | awk -F '@' '{print$2}')" - # echo "${SOURCE}" - # exit - break - fi - ;; - *) - echo -e "\n$WARN 请输入数字序号以选择你想使用的软件源!" - ;; - esac - done - fi -} - -## 选择同步软件源所使用的 WEB 协议( HTTP:80 端口,HTTPS:443 端口) -function ChooseWebProtocol() { - if [[ -z "${WEB_PROTOCOL}" ]]; then - if [[ "${ONLY_HTTP}" == "True" ]]; then - WEB_PROTOCOL="http" - else - local CHOICE=$(echo -e "\n${BOLD}└─ 软件源是否使用 HTTP 协议? [Y/n] ${PLAIN}") - read -p "${CHOICE}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) - WEB_PROTOCOL="http" - ;; - [Nn] | [Nn][Oo]) - WEB_PROTOCOL="https" - ;; - *) - echo -e "\n$WARN 输入错误,默认使用 HTTPS 协议!" - WEB_PROTOCOL="https" - ;; - esac - fi - fi - WEB_PROTOCOL="${WEB_PROTOCOL,,}" -} - -## 备份原有软件源 -function BackupOriginMirrors() { - BACKUPED="false" - if [[ "${BACKUP}" == "true" ]]; then - local VERIFICATION_FILES=1 - local VERIFICATION_BACKUPFILES=1 - - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - ## 判断 /etc/apt/sources.list.d 目录下是否存在文件 - [ -d $Dir_DebianExtendSource ] && ls $Dir_DebianExtendSource | grep *.list -q - VERIFICATION_FILES=$? - ## 判断 /etc/apt/sources.list.d.bak 目录下是否存在文件 - [ -d $Dir_DebianExtendSourceBackup ] && ls $Dir_DebianExtendSourceBackup | grep *.list -q - VERIFICATION_BACKUPFILES=$? - ;; - "${SYSTEM_REDHAT}") - ## 判断 /etc/yum.repos.d 目录下是否存在文件 - [ -d $Dir_RedHatRepos ] && ls $Dir_RedHatRepos | grep '\.repo$' -q - VERIFICATION_FILES=$? - ## 判断 /etc/yum.repos.d.bak 目录下是否存在文件 - [ -d $Dir_RedHatReposBackup ] && ls $Dir_RedHatReposBackup | grep '\.repo$' -q - VERIFICATION_BACKUPFILES=$? - ;; - "${SYSTEM_OPENEULER}") - ## 判断 /etc/yum.repos.d 目录下是否存在文件 - [ -d $Dir_openEulerRepos ] && ls $Dir_openEulerRepos | grep '\.repo$' -q - VERIFICATION_FILES=$? - ## 判断 /etc/yum.repos.d.bak 目录下是否存在文件 - [ -d $Dir_openEulerReposBackup ] && ls $Dir_openEulerReposBackup | grep '\.repo$' -q - VERIFICATION_BACKUPFILES=$? - ;; - "${SYSTEM_OPENSUSE}") - ## 判断 /etc/zypp/repos.d 目录下是否存在文件 - [ -d $Dir_openSUSERepos ] && ls $Dir_openSUSERepos | grep '\.repo$' -q - VERIFICATION_FILES=$? - ## 判断 /etc/zypp/repos.d.bak 目录下是否存在文件 - [ -d $Dir_openSUSEReposBackup ] && ls $Dir_openSUSEReposBackup | grep '\.repo$' -q - VERIFICATION_BACKUPFILES=$? - ;; - esac - - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - ## /etc/apt/sources.list - if [ -s $File_DebianSourceList ]; then - if [ -s $File_DebianSourceListBackup ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP1=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 list 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP1}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $File_DebianSourceList $File_DebianSourceListBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - echo '' - cp -rvf $File_DebianSourceList $File_DebianSourceListBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 list 源文件" - sleep 1s - fi - else - [ ! -f $File_DebianSourceList ] && touch $File_DebianSourceList - echo -e '' - fi - - ## /etc/apt/sources.list.d - if [ -d $Dir_DebianExtendSource ] && [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_DebianExtendSourceBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP2=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 list 扩展源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP2}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_DebianExtendSource/* $Dir_DebianExtendSourceBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_DebianExtendSourceBackup ] && mkdir -p $Dir_DebianExtendSourceBackup - echo '' - cp -rvf $Dir_DebianExtendSource/* $Dir_DebianExtendSourceBackup 2>&1 - BACKUPED="true" - echo -e "$COMPLETE 已备份原有 list 扩展源文件" - sleep 1s - fi - fi - ;; - "${SYSTEM_REDHAT}") - ## /etc/yum.repos.d - if [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_RedHatReposBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP3=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 repo 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP3}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_RedHatRepos/* $Dir_RedHatReposBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_RedHatReposBackup ] && mkdir -p $Dir_RedHatReposBackup - echo '' - cp -rvf $Dir_RedHatRepos/* $Dir_RedHatReposBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 repo 源文件" - sleep 1s - fi - else - [ -d $Dir_RedHatRepos ] || mkdir -p $Dir_RedHatRepos - fi - ;; - "${SYSTEM_OPENEULER}") - ## /etc/yum.repos.d - if [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_openEulerReposBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP4=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 repo 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP4}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_openEulerRepos/* $Dir_openEulerReposBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_openEulerReposBackup ] && mkdir -p $Dir_openEulerReposBackup - echo '' - cp -rvf $Dir_openEulerRepos/* $Dir_openEulerReposBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 repo 源文件" - sleep 1s - fi - else - [ -d $Dir_openEulerRepos ] || mkdir -p $Dir_openEulerRepos - fi - ;; - "${SYSTEM_OPENSUSE}") - ## /etc/zypp/repos.d - if [ ${VERIFICATION_FILES} -eq 0 ]; then - if [ -d $Dir_openSUSEReposBackup ] && [ ${VERIFICATION_BACKUPFILES} -eq 0 ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP4=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的 repo 源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP4}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $Dir_openSUSERepos/* $Dir_openSUSEReposBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - [ ! -d $Dir_openSUSEReposBackup ] && mkdir -p $Dir_openSUSEReposBackup - echo '' - cp -rvf $Dir_openSUSERepos/* $Dir_openSUSEReposBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有 repo 源文件" - sleep 1s - fi - else - [ -d $Dir_openSUSERepos ] || mkdir -p $Dir_openSUSERepos - fi - ;; - "${SYSTEM_ARCH}") - ## /etc/pacman.d/mirrorlist - if [ -s $File_ArchMirrorList ]; then - if [ -s $File_ArchMirrorListBackup ]; then - if [[ "${IGNORE_BACKUP_TIPS}" == "false" ]]; then - local CHOICE_BACKUP5=$(echo -e "\n${BOLD}└─ 检测到系统中存在已备份的软件源文件,是否跳过覆盖备份? [Y/n] ${PLAIN}") - read -p "${CHOICE_BACKUP5}" INPUT - [[ -z "${INPUT}" ]] && INPUT=Y - case "${INPUT}" in - [Yy] | [Yy][Ee][Ss]) ;; - [Nn] | [Nn][Oo]) - echo '' - cp -rvf $File_ArchMirrorList $File_ArchMirrorListBackup 2>&1 - BACKUPED="true" - ;; - *) - echo -e "\n$WARN 输入错误,默认不覆盖!" - ;; - esac - fi - else - echo '' - cp -rvf $File_ArchMirrorList $File_ArchMirrorListBackup 2>&1 - BACKUPED="true" - echo -e "\n$COMPLETE 已备份原有软件源文件" - sleep 1s - fi - else - [ ! -f $File_ArchMirrorList ] && touch $File_ArchMirrorList - echo -e '' - fi - ;; - esac - fi -} - -## 移除原有软件源 -function RemoveOriginMirrors() { - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - [ -f $File_DebianSourceList ] && sed -i '1,$d' $File_DebianSourceList - ;; - "${SYSTEM_REDHAT}") - if [ -d $Dir_RedHatRepos ]; then - # Fedora Linux 特殊,只删除以 fedora 开头的文件 - case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_FEDORA}") - rm -rf $Dir_RedHatRepos/fedora* - ;; - *) - if [ -f $Dir_RedHatRepos/epel.repo ]; then - ls $Dir_RedHatRepos/ | egrep -v epel | xargs rm -rf - else - rm -rf $Dir_RedHatRepos/* - fi - ;; - esac - fi - ;; - "${SYSTEM_OPENEULER}") - [ -d $Dir_openEulerRepos ] && rm -rf $Dir_openEulerRepos/* - ;; - "${SYSTEM_OPENSUSE}") - [ -d $Dir_openSUSERepos ] && rm -rf $Dir_openSUSERepos/repo-* - ;; - "${SYSTEM_ARCH}") - [ -f $File_ArchMirrorList ] && sed -i '1,$d' $File_ArchMirrorList - ;; - esac -} - -## 换源 -function ChangeMirrors() { - ## 打印修改前后差异 - function PrintDiff() { - ## Debian/Arch 比较模式 - function DiffMode1() { - local backup_file=$1 - local origin_file=$2 - if [[ -s $backup_file && -s $origin_file ]]; then - if [[ "$(cat $backup_file)" != "$(cat $origin_file)" ]]; then - echo -e "\n${BLUE}${backup_file}${PLAIN} -> ${BLUE}${origin_file}${PLAIN}" - diff $backup_file $origin_file -d --color=always -I -B -E - fi - fi - } - ## RedHat/openEuler/openSUSE 比较模式 - function DiffMode2() { - local backup_dir=$1 - local origin_dir=$2 - local backup_file origin_file - for item in $(ls $backup_dir | xargs); do - backup_file="$backup_dir/$item" - origin_file="$origin_dir/$item" - if [[ "$(cat $backup_file)" != "$(cat $origin_file)" ]]; then - echo -e "\n${BLUE}${backup_file}${PLAIN} -> ${BLUE}${origin_file}${PLAIN}" - diff $backup_file $origin_file -d --color=always -I -B -E - fi - done - } - - if [[ "${PRINT_DIFF}" == "true" ]]; then - if [[ -x /usr/bin/diff && "${BACKUPED}" == "true" ]]; then - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - DiffMode1 $File_DebianSourceListBackup $File_DebianSourceList - ;; - "${SYSTEM_REDHAT}") - DiffMode2 $Dir_RedHatReposBackup $Dir_RedHatRepos - ;; - "${SYSTEM_OPENEULER}") - DiffMode2 $Dir_openEulerReposBackup $Dir_openEulerRepos - ;; - "${SYSTEM_OPENSUSE}") - DiffMode2 $Dir_openSUSEReposBackup $Dir_openSUSERepos - ;; - "${SYSTEM_ARCH}") - DiffMode1 $File_ArchMirrorListBackup $File_ArchMirrorList - ;; - esac - fi - fi - } - - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - DebianMirrors - ;; - "${SYSTEM_REDHAT}") - RedHatMirrors - ;; - "${SYSTEM_OPENEULER}") - openEulerMirrors - ;; - "${SYSTEM_OPENSUSE}") - openSUSEMirrors - ;; - "${SYSTEM_ARCH}") - ArchMirrors - ;; - esac - PrintDiff - case "${SYSTEM_FACTIONS}" in - "${SYSTEM_DEBIAN}") - echo -e "\n$COMPLETE 软件源更换完毕,你可以在之后使用 ${BLUE}apt-get update${PLAIN} 命令${SYNC_TXT}软件源\n" - ;; - "${SYSTEM_REDHAT}" | "${SYSTEM_OPENEULER}") - echo -e "\n$COMPLETE 软件源更换完毕,你可以在之后使用 ${BLUE}yum makecache${PLAIN} 命令${SYNC_TXT}软件源\n" - ;; - "${SYSTEM_OPENSUSE}") - echo -e "\n$COMPLETE 软件源更换完毕,你可以在之后使用 ${BLUE}zypper ref${PLAIN} 命令${SYNC_TXT}软件源\n" - ;; - "${SYSTEM_ARCH}") - echo -e "\n$COMPLETE 软件源更换完毕,你可以在之后使用 ${BLUE}pacman -Sy${PLAIN} 命令${SYNC_TXT}软件源\n" - ;; - esac -} - -############################################################################## - -## 更换基于 Debian 系 Linux 发行版的软件源 -function DebianMirrors() { - local source_suffix - local TIPS="## 默认禁用源码镜像以提高速度,如需启用请自行取消注释" - local basic_url="${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}" - case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_DEBIAN}") - case "${SYSTEM_VERSION_NUMBER}" in - 12) - source_suffix="main contrib non-free non-free-firmware" - ;; - *) - source_suffix="main contrib non-free" - ;; - esac - echo "${TIPS} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME} ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME} ${source_suffix} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME}-updates ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME}-updates ${source_suffix} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME}-backports ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME}-backports ${source_suffix}" >>$File_DebianSourceList - ## 处理 debian-security 仓库 - local security_url="${SOURCE_SECURITY:-"${SOURCE}"}" - if [[ -z "${SOURCE_SECURITY}" ]]; then - local security_url="${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH_SECURITY:-"${SOURCE_BRANCH}-security"}" - else - local security_url="${WEB_PROTOCOL}://${SOURCE_SECURITY}/${SOURCE_BRANCH_SECURITY:-"${SOURCE_BRANCH}-security"}" - fi - echo "deb ${security_url} ${SYSTEM_VERSION_CODENAME}-security ${source_suffix} -# deb-src ${security_url} ${SYSTEM_VERSION_CODENAME}-security ${source_suffix}" >>$File_DebianSourceList - ;; - "${SYSTEM_UBUNTU}") - source_suffix="main restricted universe multiverse" - echo "${TIPS} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME} ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME} ${source_suffix} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME}-updates ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME}-updates ${source_suffix} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME}-backports ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME}-backports ${source_suffix} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME}-security ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME}-security ${source_suffix} - -## 预发布软件源(不建议启用) -# deb ${basic_url} ${SYSTEM_VERSION_CODENAME}-proposed ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME}-proposed ${source_suffix}" >>$File_DebianSourceList - ;; - "${SYSTEM_KALI}") - source_suffix="main non-free contrib" - echo "${TIPS} -deb ${basic_url} ${SYSTEM_VERSION_CODENAME} ${source_suffix} -# deb-src ${basic_url} ${SYSTEM_VERSION_CODENAME} ${source_suffix}" >>$File_DebianSourceList - ;; - esac -} - -## 更换基于 RedHat 系 Linux 发行版软件源 -function RedHatMirrors() { - ## 生成基于 RedHat 发行版和及其衍生发行版的官方 repo 源文件 - case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_RHEL}") - case ${SYSTEM_VERSION_NUMBER:0:1} in - 9) - GenRepoFiles_RockyLinux ${SYSTEM_VERSION_NUMBER:0:1} - ;; - *) - GenRepoFiles_CentOS ${SYSTEM_VERSION_NUMBER:0:1} - ;; - esac - ;; - "${SYSTEM_CENTOS}") - GenRepoFiles_CentOS ${SYSTEM_VERSION_NUMBER:0:1} - ;; - "${SYSTEM_CENTOS_STREAM}") - GenRepoFiles_CentOSStream ${SYSTEM_VERSION_NUMBER:0:1} - ;; - "${SYSTEM_ROCKY}") - GenRepoFiles_RockyLinux ${SYSTEM_VERSION_NUMBER:0:1} - ;; - "${SYSTEM_ALMA}") - GenRepoFiles_AlmaLinux ${SYSTEM_VERSION_NUMBER:0:1} - ;; - "${SYSTEM_FEDORA}") - GenRepoFiles_Fedora - ;; - esac - - ## 修改源 - cd $Dir_RedHatRepos - case "${SYSTEM_JUDGMENT}" in - "${SYSTEM_RHEL}") - case ${SYSTEM_VERSION_NUMBER:0:1} in - 9) - # wget "${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}/RPM-GPG-KEY-rockyofficial" -P /etc/pki/rpm-gpg - # wget "${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}/RPM-GPG-KEY-Rocky-9" -P /etc/pki/rpm-gpg - sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|^mirrorlist=|#mirrorlist=|g" \ - -e "s|^gpgcheck=1|gpgcheck=0|g" \ - -e "s|^gpgkey=|#gpgkey=|g" \ - -e "s|dl.rockylinux.org/\$contentdir|${SOURCE}/${SOURCE_BRANCH}|g" \ - -i \ - rocky.repo \ - rocky-addons.repo \ - rocky-devel.repo \ - rocky-extras.repo - ;; - *) - sed -i "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" CentOS-* - sed -i 's|^mirrorlist=|#mirrorlist=|g' CentOS-* - case ${SYSTEM_VERSION_NUMBER:0:1} in - 8) - sed -i 's|mirror.centos.org/$contentdir|mirror.centos.org/centos-vault|g' CentOS-* - sed -i "s/\$releasever/8.5.2111/g" CentOS-* - # 单独处理 CentOS-Linux-Sources.repo - sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos-vault"}|g" CentOS-Linux-Sources.repo - ;; - 7) - sed -i "s|mirror.centos.org/\$contentdir|mirror.centos.org/${SOURCE_BRANCH}|g" CentOS-* - sed -i "s/\$releasever/7/g" CentOS-* - # 单独处理 CentOS-Sources.repo - sed -i "s|vault.centos.org/centos|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos"}|g" CentOS-Sources.repo - ;; - esac - sed -i "s|mirror.centos.org|${SOURCE}|g" CentOS-* - ;; - esac - ;; - "${SYSTEM_CENTOS}") - sed -i "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" CentOS-* - sed -i 's|^mirrorlist=|#mirrorlist=|g' CentOS-* - case ${SYSTEM_VERSION_NUMBER:0:1} in - 8) - ## CentOS 8 操作系统版本结束了生命周期(EOL),Linux 社区已不再维护该操作系统版本,最终版本为 8.5.2011 - # 原 centos 镜像中的 CentOS 8 相关内容已被官方移动,从 2022-02 开始切换至 centos-vault 源 - sed -i 's|mirror.centos.org/$contentdir|mirror.centos.org/centos-vault|g' CentOS-* - sed -i "s/\$releasever/8.5.2111/g" CentOS-* - # 单独处理 CentOS-Linux-Sources.repo - sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos-vault"}|g" CentOS-Linux-Sources.repo - ;; - 7) - sed -i "s|mirror.centos.org/\$contentdir|mirror.centos.org/${SOURCE_BRANCH}|g" CentOS-* - sed -i "s|vault.centos.org/centos|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos"}|g" CentOS-Sources.repo # 单独处理 CentOS-Sources.repo - ;; - esac - sed -i "s|mirror.centos.org|${SOURCE}|g" CentOS-* - ;; - "${SYSTEM_CENTOS_STREAM}") - # CentOS Stream 9 使用的是 centos-stream 镜像,而 CentOS Stream 8 使用的是 centos 镜像 - case ${SYSTEM_VERSION_NUMBER:0:1} in - 9) - sed -e "s|^#baseurl=https|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|^metalink=|#metalink=|g" \ - -e "s|mirror.stream.centos.org|${SOURCE}/${SOURCE_BRANCH}|g" \ - -i \ - centos.repo \ - centos-addons.repo - ;; - 8) - sed -i "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"mirror.centos.org"}/${SOURCE_BRANCH_VAULT:-"centos"}|g" CentOS-Stream-Sources.repo # 单独处理 CentOS-Stream-Sources.repo - sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|^mirrorlist=|#mirrorlist=|g" \ - -e "s|mirror.centos.org/\$contentdir|${SOURCE}/${SOURCE_BRANCH}|g" \ - -i \ - CentOS-Stream-* - ;; - esac - ;; - "${SYSTEM_ROCKY}") - case ${SYSTEM_VERSION_NUMBER:0:1} in - 9) - sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|^mirrorlist=|#mirrorlist=|g" \ - -e "s|dl.rockylinux.org/\$contentdir|${SOURCE}/${SOURCE_BRANCH}|g" \ - -i \ - rocky.repo \ - rocky-addons.repo \ - rocky-devel.repo \ - rocky-extras.repo - ;; - 8) - sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|^mirrorlist=|#mirrorlist=|g" \ - -e "s|dl.rockylinux.org/\$contentdir|${SOURCE}/${SOURCE_BRANCH}|g" \ - -i \ - Rocky-* - ;; - esac - ;; - "${SYSTEM_ALMA}") - case ${SYSTEM_VERSION_NUMBER:0:1} in - 9) - sed -e "s|^# baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|^mirrorlist=|#mirrorlist=|g" \ - -e "s|repo.almalinux.org/almalinux|${SOURCE}/${SOURCE_BRANCH}|g" \ - -e "s|repo.almalinux.org/vault|${SOURCE}/${SOURCE_BRANCH}-vault|g" \ - -i \ - almalinux-* - ;; - 8) - sed -e "s|^mirrorlist=|#mirrorlist=|g" \ - -e "s|^# baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|repo.almalinux.org/almalinux|${SOURCE}/${SOURCE_BRANCH}|g" \ - -e "s|repo.almalinux.org/vault|${SOURCE}/${SOURCE_BRANCH}-vault|g" \ - -i \ - almalinux-ha.repo \ - almalinux-nfv.repo \ - almalinux-plus.repo \ - almalinux-powertools.repo \ - almalinux-resilientstorage.repo \ - almalinux-rt.repo \ - almalinux-sap.repo \ - almalinux-saphana.repo \ - almalinux.repo - ;; - esac - ;; - "${SYSTEM_FEDORA}") - sed -e "s|^metalink=|#metalink=|g" \ - -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|download.example/pub/fedora/linux|${SOURCE}/${SOURCE_BRANCH}|g" \ - -i \ - fedora.repo \ - fedora-updates.repo \ - fedora-modular.repo \ - fedora-updates-modular.repo \ - fedora-updates-testing.repo \ - fedora-updates-testing-modular.repo - ;; - esac -} - -## 更换基于 openEuler 发行版的软件源 -function openEulerMirrors() { - GenRepoFiles_openEuler - cd $Dir_openEulerRepos - - sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ - -e "s|repo.openeuler.org|${SOURCE}/${SOURCE_BRANCH}|g" \ - -i \ - openEuler.repo -} - -## 更换基于 openSUSE 发行版的软件源 -function openSUSEMirrors() { - case "${SYSTEM_ID}" in - "opensuse-leap") - GenRepoFiles_openSUSE "leap" "${SYSTEM_VERSION_NUMBER}" - ;; - "opensuse-tumbleweed") - GenRepoFiles_openSUSE "tumbleweed" - ;; - esac - cd $Dir_openSUSERepos - - # 更换 WEB 协议(HTTP/HTTPS) - sed -i "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" repo-* - # 更换软件源 - case "${SYSTEM_ID}" in - opensuse-leap) - case "${SYSTEM_VERSION_NUMBER}" in - 15.[0-2]) - sed -i "s|download.opensuse.org|${SOURCE}/${SOURCE_BRANCH}|g" \ - repo-debug-non-oss.repo \ - repo-debug.repo \ - repo-debug-update-non-oss.repo \ - repo-debug-update.repo \ - repo-non-oss.repo \ - repo-oss.repo \ - repo-source-non-oss.repo \ - repo-source.repo \ - repo-update-non-oss.repo \ - repo-update.repo - ;; - *) - sed -i "s|download.opensuse.org|${SOURCE}/${SOURCE_BRANCH}|g" \ - repo-backports-debug-update.repo \ - repo-backports-update.repo \ - repo-debug-non-oss.repo \ - repo-debug.repo \ - repo-debug-update-non-oss.repo \ - repo-debug-update.repo \ - repo-non-oss.repo \ - repo-oss.repo \ - repo-sle-debug-update.repo \ - repo-sle-update.repo \ - repo-source.repo \ - repo-update-non-oss.repo \ - repo-update.repo - ;; - esac - ;; - opensuse-tumbleweed) - sed -i "s|download.opensuse.org|${SOURCE}/${SOURCE_BRANCH}|g" \ - repo-debug.repo \ - repo-non-oss.repo \ - repo-openh264.repo \ - repo-oss.repo \ - repo-source.repo \ - repo-update.repo - ;; - esac -} - -## 更换基于 Arch Linux 发行版的软件源 -function ArchMirrors() { - case "${SOURCE_BRANCH}" in - "archlinuxarm") - echo "Server = ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}/\$arch/\$repo" >>$File_ArchMirrorList - ;; - "archlinuxcn") - echo "Server = ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}/\$arch" >>$File_ArchMirrorList - ;; - *) - echo "Server = ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}/\$repo/os/\$arch" >>$File_ArchMirrorList - ;; - esac -} - -## 生成 CentOS 官方 repo 源文件 -function GenRepoFiles_CentOS() { - case $1 in - 8) - cat >$Dir_RedHatRepos/CentOS-Linux-AppStream.repo <<\EOF -# CentOS-Linux-AppStream.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[appstream] -name=CentOS Linux $releasever - AppStream -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-BaseOS.repo <<\EOF -# CentOS-Linux-BaseOS.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[baseos] -name=CentOS Linux $releasever - BaseOS -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-ContinuousRelease.repo <<\EOF -# CentOS-Linux-ContinuousRelease.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. -# -# The Continuous Release (CR) repository contains packages for the next minor -# release of CentOS Linux. This repository only has content in the time period -# between an upstream release and the official CentOS Linux release. These -# packages have not been fully tested yet and should be considered beta -# quality. They are made available for people willing to test and provide -# feedback for the next release. - -[cr] -name=CentOS Linux $releasever - ContinuousRelease -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=cr&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/cr/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Debuginfo.repo <<\EOF -# CentOS-Linux-Debuginfo.repo -# -# All debug packages are merged into a single repo, split by basearch, and are -# not signed. - -[debuginfo] -name=CentOS Linux $releasever - Debuginfo -baseurl=http://debuginfo.centos.org/$releasever/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Devel.repo <<\EOF -# CentOS-Linux-Devel.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[devel] -name=CentOS Linux $releasever - Devel WARNING! FOR BUILDROOT USE ONLY! -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=Devel&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/Devel/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Extras.repo <<\EOF -# CentOS-Linux-Extras.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[extras] -name=CentOS Linux $releasever - Extras -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/extras/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-FastTrack.repo <<\EOF -# CentOS-Linux-FastTrack.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[fasttrack] -name=CentOS Linux $releasever - FastTrack -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=fasttrack&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/fasttrack/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-HighAvailability.repo <<\EOF -# CentOS-Linux-HighAvailability.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[ha] -name=CentOS Linux $releasever - HighAvailability -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=HighAvailability&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/HighAvailability/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Media.repo <<\EOF -# CentOS-Linux-Media.repo -# -# You can use this repo to install items directly off the installation media. -# Verify your mount point matches one of the below file:// paths. - -[media-baseos] -name=CentOS Linux $releasever - Media - BaseOS -baseurl=file:///media/CentOS/BaseOS - file:///media/cdrom/BaseOS - file:///media/cdrecorder/BaseOS -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[media-appstream] -name=CentOS Linux $releasever - Media - AppStream -baseurl=file:///media/CentOS/AppStream - file:///media/cdrom/AppStream - file:///media/cdrecorder/AppStream -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Plus.repo <<\EOF -# CentOS-Linux-Plus.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[plus] -name=CentOS Linux $releasever - Plus -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/centosplus/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-PowerTools.repo <<\EOF -# CentOS-Linux-PowerTools.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[powertools] -name=CentOS Linux $releasever - PowerTools -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Linux-Sources.repo <<\EOF -# CentOS-Linux-Sources.repo - - -[baseos-source] -name=CentOS Linux $releasever - BaseOS - Source -baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[appstream-source] -name=CentOS Linux $releasever - AppStream - Source -baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[extras-source] -name=CentOS Linux $releasever - Extras - Source -baseurl=http://vault.centos.org/$contentdir/$releasever/extras/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[plus-source] -name=CentOS Linux $releasever - Plus - Source -baseurl=http://vault.centos.org/$contentdir/$releasever/centosplus/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - ;; - 7) - cat >$Dir_RedHatRepos/CentOS-Base.repo <<\EOF -# CentOS-Base.repo -# -# The mirror system uses the connecting IP address of the client and the -# update status of each mirror to pick mirrors that are updated to and -# geographically close to the client. You should use this for CentOS updates -# unless you are manually picking other mirrors. -# -# If the mirrorlist= does not work for you, as a fall back you can try the -# remarked out baseurl= line instead. -# -# - -[base] -name=CentOS-$releasever - Base -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#released updates -[updates] -name=CentOS-$releasever - Updates -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that may be useful -[extras] -name=CentOS-$releasever - Extras -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that extend functionality of existing packages -[centosplus] -name=CentOS-$releasever - Plus -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 -EOF - cat >$Dir_RedHatRepos/CentOS-CR.repo <<\EOF -# CentOS-CR.repo -# -# The Continuous Release ( CR ) repository contains rpms that are due in the next -# release for a specific CentOS Version ( eg. next release in CentOS-7 ); these rpms -# are far less tested, with no integration checking or update path testing having -# taken place. They are still built from the upstream sources, but might not map -# to an exact upstream distro release. -# -# These packages are made available soon after they are built, for people willing -# to test their environments, provide feedback on content for the next release, and -# for people looking for early-access to next release content. -# -# The CR repo is shipped in a disabled state by default; its important that users -# understand the implications of turning this on. -# -# NOTE: We do not use a mirrorlist for the CR repos, to ensure content is available -# to everyone as soon as possible, and not need to wait for the external -# mirror network to seed first. However, many local mirrors will carry CR repos -# and if desired you can use one of these local mirrors by editing the baseurl -# line in the repo config below. -# - -[cr] -name=CentOS-$releasever - cr -baseurl=http://mirror.centos.org/centos/$releasever/cr/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 -enabled=0 -EOF - cat >$Dir_RedHatRepos/CentOS-Debuginfo.repo <<\EOF -# CentOS-Debug.repo -# -# The mirror system uses the connecting IP address of the client and the -# update status of each mirror to pick mirrors that are updated to and -# geographically close to the client. You should use this for CentOS updates -# unless you are manually picking other mirrors. -# - -# All debug packages from all the various CentOS-7 releases -# are merged into a single repo, split by BaseArch -# -# Note: packages in the debuginfo repo are currently not signed -# - -[base-debuginfo] -name=CentOS-7 - Debuginfo -baseurl=http://debuginfo.centos.org/7/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7 -enabled=0 -# -EOF - cat >$Dir_RedHatRepos/CentOS-fasttrack.repo <<\EOF -[fasttrack] -name=CentOS-7 - fasttrack -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=fasttrack&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/fasttrack/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 -EOF - cat >$Dir_RedHatRepos/CentOS-Media.repo <<\EOF -# CentOS-Media.repo -# -# This repo can be used with mounted DVD media, verify the mount point for -# CentOS-7. You can use this repo and yum to install items directly off the -# DVD ISO that we release. -# -# To use this repo, put in your DVD and use it with the other repos too: -# yum --enablerepo=c7-media [command] -# -# or for ONLY the media repo, do this: -# -# yum --disablerepo=\* --enablerepo=c7-media [command] - -[c7-media] -name=CentOS-$releasever - Media -baseurl=file:///media/CentOS/ - file:///media/cdrom/ - file:///media/cdrecorder/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 -EOF - cat >$Dir_RedHatRepos/CentOS-Sources.repo <<\EOF -# CentOS-Sources.repo -# -# The mirror system uses the connecting IP address of the client and the -# update status of each mirror to pick mirrors that are updated to and -# geographically close to the client. You should use this for CentOS updates -# unless you are manually picking other mirrors. -# -# If the mirrorlist= does not work for you, as a fall back you can try the -# remarked out baseurl= line instead. -# -# - -[base-source] -name=CentOS-$releasever - Base Sources -baseurl=http://vault.centos.org/centos/$releasever/os/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#released updates -[updates-source] -name=CentOS-$releasever - Updates Sources -baseurl=http://vault.centos.org/centos/$releasever/updates/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that may be useful -[extras-source] -name=CentOS-$releasever - Extras Sources -baseurl=http://vault.centos.org/centos/$releasever/extras/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that extend functionality of existing packages -[centosplus-source] -name=CentOS-$releasever - Plus Sources -baseurl=http://vault.centos.org/centos/$releasever/centosplus/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 -EOF - ;; - esac -} - -## 生成 CentOS Stream 官方 repo 源文件 -function GenRepoFiles_CentOSStream() { - case $1 in - 9) - cat >$Dir_RedHatRepos/centos.repo <<\EOF -[baseos] -name=CentOS Stream $releasever - BaseOS -#baseurl=https://mirror.stream.centos.org/$releasever-stream/BaseOS/$basearch/os/ -metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=1 - -[baseos-debug] -name=CentOS Stream $releasever - BaseOS - Debug -metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-debug-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[baseos-source] -name=CentOS Stream $releasever - BaseOS - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[appstream] -name=CentOS Stream $releasever - AppStream -#baseurl=https://mirror.stream.centos.org/$releasever-stream/AppStream/$basearch/os/ -metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=1 - -[appstream-debug] -name=CentOS Stream $releasever - AppStream - Debug -metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-debug-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[appstream-source] -name=CentOS Stream $releasever - AppStream - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[crb] -name=CentOS Stream $releasever - CRB -#baseurl=https://mirror.stream.centos.org/$releasever-stream/CRB/$basearch/os/ -metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=0 - -[crb-debug] -name=CentOS Stream $releasever - CRB - Debug -metalink=https://mirrors.centos.org/metalink?repo=centos-crb-debug-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[crb-source] -name=CentOS Stream $releasever - CRB - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-crb-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 -EOF - cat >$Dir_RedHatRepos/centos-addons.repo <<\EOF -[highavailability] -name=CentOS Stream $releasever - HighAvailability -#baseurl=https://mirror.stream.centos.org/$releasever-stream/HighAvailability/$basearch/os/ -metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=0 - -[highavailability-debug] -name=CentOS Stream $releasever - HighAvailability - Debug -metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-debug-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[highavailability-source] -name=CentOS Stream $releasever - HighAvailability - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[nfv] -name=CentOS Stream $releasever - NFV -#baseurl=https://mirror.stream.centos.org/$releasever-stream/NFV/$basearch/os/ -metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=0 - -[nfv-debug] -name=CentOS Stream $releasever - NFV - Debug -metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-debug-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[nfv-source] -name=CentOS Stream $releasever - NFV - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[rt] -name=CentOS Stream $releasever - RT -#baseurl=https://mirror.stream.centos.org/$releasever-stream/RT/$basearch/os/ -metalink=https://mirrors.centos.org/metalink?repo=centos-rt-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=0 - -[rt-debug] -name=CentOS Stream $releasever - RT - Debug -metalink=https://mirrors.centos.org/metalink?repo=centos-rt-debug-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[rt-source] -name=CentOS Stream $releasever - RT - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-rt-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[resilientstorage] -name=CentOS Stream $releasever - ResilientStorage -#baseurl=https://mirror.stream.centos.org/$releasever-stream/ResilientStorage/$basearch/os/ -metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=0 - -[resilientstorage-debug] -name=CentOS Stream $releasever - ResilientStorage - Debug -metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-debug-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[resilientstorage-source] -name=CentOS Stream $releasever - ResilientStorage - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 - -[extras-common] -name=CentOS Stream $releasever - Extras packages -#baseurl=https://mirror.stream.centos.org/SIGs/$releasever-stream/extras/$basearch/extras-common/ -metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=1 - -[extras-common-source] -name=CentOS Stream $releasever - Extras packages - Source -metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-source-$stream&arch=source&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -enabled=0 -EOF - ;; - 8) - cat >$Dir_RedHatRepos/CentOS-Stream-AppStream.repo <<\EOF -# CentOS-Stream-AppStream.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[appstream] -name=CentOS Stream $releasever - AppStream -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-BaseOS.repo <<\EOF -# CentOS-Stream-BaseOS.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[baseos] -name=CentOS Stream $releasever - BaseOS -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/BaseOS/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Debuginfo.repo <<\EOF -# CentOS-Stream-Debuginfo.repo -# -# All debug packages are merged into a single repo, split by basearch, and are -# not signed. - -[debuginfo] -name=CentOS Stream $releasever - Debuginfo -baseurl=http://debuginfo.centos.org/$stream/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Extras-common.repo <<\EOF -# CentOS-Stream-Extras-common.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[extras-common] -name=CentOS Stream $releasever - Extras common packages -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=extras-extras-common -#baseurl=http://mirror.centos.org/$contentdir/$stream/extras/$basearch/extras-common/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Extras.repo <<\EOF -# CentOS-Stream-Extras.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[extras] -name=CentOS Stream $releasever - Extras -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=extras&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/extras/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-HighAvailability.repo <<\EOF -# CentOS-Stream-HighAvailability.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[ha] -name=CentOS Stream $releasever - HighAvailability -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=HighAvailability&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/HighAvailability/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Media.repo <<\EOF -# CentOS-Stream-Media.repo -# -# You can use this repo to install items directly off the installation media. -# Verify your mount point matches one of the below file:// paths. - -[media-baseos] -name=CentOS Stream $releasever - Media - BaseOS -baseurl=file:///media/CentOS/BaseOS - file:///media/cdrom/BaseOS - file:///media/cdrecorder/BaseOS -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[media-appstream] -name=CentOS Stream $releasever - Media - AppStream -baseurl=file:///media/CentOS/AppStream - file:///media/cdrom/AppStream - file:///media/cdrecorder/AppStream -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-NFV.repo <<\EOF -# CentOS-Stream-NFV.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[nfv] -name=CentOS Stream $releasever - NFV -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=NFV&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/NFV/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-PowerTools.repo <<\EOF -# CentOS-Stream-PowerTools.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[powertools] -name=CentOS Stream $releasever - PowerTools -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=PowerTools&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/PowerTools/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-RealTime.repo <<\EOF -# CentOS-Stream-RealTime.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[rt] -name=CentOS Stream $releasever - RealTime -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=RT&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/RT/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-ResilientStorage.repo <<\EOF -# CentOS-Stream-ResilientStorage.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[resilientstorage] -name=CentOS Stream $releasever - ResilientStorage -mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=ResilientStorage&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$stream/ResilientStorage/$basearch/os/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - cat >$Dir_RedHatRepos/CentOS-Stream-Sources.repo <<\EOF -# CentOS-Stream-Sources.repo - -[baseos-source] -name=CentOS Stream $releasever - BaseOS - Source -baseurl=http://vault.centos.org/$contentdir/$stream/BaseOS/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[appstream-source] -name=CentOS Stream $releasever - AppStream - Source -baseurl=http://vault.centos.org/$contentdir/$stream/AppStream/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[powertools-source] -name=CentOS Stream $releasever - PowerTools - Source -baseurl=http://vault.centos.org/$contentdir/$stream/PowerTools/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[extras-source] -name=CentOS Stream $releasever - Extras - Source -baseurl=http://vault.centos.org/$contentdir/$stream/extras/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[ha-source] -name=CentOS Stream $releasever - HighAvailability - Source -baseurl=http://vault.centos.org/$contentdir/$stream/HighAvailability/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[rt-source] -name=CentOS Stream $releasever - RT - Source -baseurl=http://vault.centos.org/$contentdir/$stream/RT/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[resilientstorage-source] -name=CentOS Stream $releasever - ResilientStorage - Source -baseurl=http://vault.centos.org/$contentdir/$stream/ResilientStorage/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial - -[nfv-source] -name=CentOS Stream $releasever - NFV - Source -baseurl=http://vault.centos.org/$contentdir/$stream/NFV/Source/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -EOF - ;; - esac -} - -## 生成 Rocky Linux 官方 repo 源文件 -function GenRepoFiles_RockyLinux() { - case $1 in - 9) - cat >$Dir_RedHatRepos/rocky.repo <<\EOF -# rocky.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[baseos] -name=Rocky Linux $releasever - BaseOS -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/ -gpgcheck=1 -enabled=1 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[baseos-debug] -name=Rocky Linux $releasever - BaseOS - Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[baseos-source] -name=Rocky Linux $releasever - BaseOS - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=BaseOS-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[appstream] -name=Rocky Linux $releasever - AppStream -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/ -gpgcheck=1 -enabled=1 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[appstream-debug] -name=Rocky Linux $releasever - AppStream - Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[appstream-source] -name=Rocky Linux $releasever - AppStream - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=AppStream-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[crb] -name=Rocky Linux $releasever - CRB -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[crb-debug] -name=Rocky Linux $releasever - CRB - Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[crb-source] -name=Rocky Linux $releasever - CRB - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=CRB-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 -EOF - cat >$Dir_RedHatRepos/rocky-addons.repo <<\EOF -# rocky-addons.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[highavailability] -name=Rocky Linux $releasever - High Availability -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[highavailability-debug] -name=Rocky Linux $releasever - High Availability - Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[highavailability-source] -name=Rocky Linux $releasever - High Availability - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=HighAvailability-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[resilientstorage] -name=Rocky Linux $releasever - Resilient Storage -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[resilientstorage-debug] -name=Rocky Linux $releasever - Resilient Storage - Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[resilientstorage-source] -name=Rocky Linux $releasever - Resilient Storage - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=ResilientStorage-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[nfv] -name=Rocky Linux $releasever - NFV -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=NFV-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/NFV/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[nfv-debug] -name=Rocky Linux $releasever - NFV Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/NFV/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[nfv-source] -name=Rocky Linux $releasever - NFV Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/NFV/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[rt] -name=Rocky Linux $releasever - Realtime -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/RT/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[rt-debug] -name=Rocky Linux $releasever - Realtime Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/RT/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[rt-source] -name=Rocky Linux $releasever - Realtime Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/RT/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[sap] -name=Rocky Linux $releasever - SAP -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAP-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAP/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[sap-debug] -name=Rocky Linux $releasever - SAP Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAP-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAP/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[sap-source] -name=Rocky Linux $releasever - SAP Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAP-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAP/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[saphana] -name=Rocky Linux $releasever - SAPHANA -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAPHANA-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAPHANA/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[saphana-debug] -name=Rocky Linux $releasever - SAPHANA Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAPHANA-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAPHANA/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[saphana-source] -name=Rocky Linux $releasever - SAPHANA Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAPHANA-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAPHANA/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 -EOF - cat >$Dir_RedHatRepos/rocky-devel.repo <<\EOF -# rocky-devel.repo -# -# devel and no-package-left-behind - -[devel] -name=Rocky Linux $releasever - Devel WARNING! FOR BUILDROOT ONLY DO NOT LEAVE ENABLED -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=devel-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/devel/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 -EOF - cat >$Dir_RedHatRepos/rocky-extras.repo <<\EOF -# rocky-extras.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[extras] -name=Rocky Linux $releasever - Extras -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/ -gpgcheck=1 -enabled=1 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[extras-debug] -name=Rocky Linux $releasever - Extras Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[extras-source] -name=Rocky Linux $releasever - Extras Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[plus] -name=Rocky Linux $releasever - Plus -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=plus-$releasever$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/plus/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[plus-debug] -name=Rocky Linux $releasever - Plus - Debug -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=plus-$releasever-debug$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/plus/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 - -[plus-source] -name=Rocky Linux $releasever - Plus - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=plus-$releasever-source$rltype -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/plus/source/tree/ -gpgcheck=1 -enabled=0 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 -EOF - ;; - 8) - cat >$Dir_RedHatRepos/Rocky-AppStream.repo <<\EOF -# Rocky-AppStream.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[appstream] -name=Rocky Linux $releasever - AppStream -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/ -gpgcheck=1 -enabled=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-BaseOS.repo <<\EOF -# Rocky-BaseOS.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[baseos] -name=Rocky Linux $releasever - BaseOS -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/ -gpgcheck=1 -enabled=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-Debuginfo.repo <<\EOF -# Rocky-Debuginfo.repo -# - -[baseos-debug] -name=Rocky Linux $releasever - BaseOS - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever-debug -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[appstream-debug] -name=Rocky Linux $releasever - AppStream - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever-debug -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[ha-debug] -name=Rocky Linux $releasever - High Availability - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever-debug -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[powertools-debug] -name=Rocky Linux $releasever - PowerTools - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=PowerTools-$releasever-debug -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/PowerTools/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[resilient-storage-debug] -name=Rocky Linux $releasever - Resilient Storage - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever-debug -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/$basearch/debug/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-Devel.repo <<\EOF -# Rocky-Devel.repo -# - -[devel] -name=Rocky Linux $releasever - Devel WARNING! FOR BUILDROOT AND KOJI USE -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=Devel-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/Devel/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-Extras.repo <<\EOF -# Rocky-Extras.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[extras] -name=Rocky Linux $releasever - Extras -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/ -gpgcheck=1 -enabled=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-HighAvailability.repo <<\EOF -# Rocky-HighAvailability.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[ha] -name=Rocky Linux $releasever - HighAvailability -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-Media.repo <<\EOF -# Rocky-Media.repo -# -# You can use this repo to install items directly off the installation media. -# Verify your mount point matches one of the below file:// paths. - -[media-baseos] -name=Rocky Linux $releasever - Media - BaseOS -baseurl=file:///media/Rocky/BaseOS - file:///media/cdrom/BaseOS - file:///media/cdrecorder/BaseOS -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[media-appstream] -name=Rocky Linux $releasever - Media - AppStream -baseurl=file:///media/Rocky/AppStream - file:///media/cdrom/AppStream - file:///media/cdrecorder/AppStream -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-NFV.repo <<\EOF -# Rocky-NFV.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[nfv] -name=Rocky Linux $releasever - NFV -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=NFV-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/nfv/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-Plus.repo <<\EOF -# Rocky-Plus.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[plus] -name=Rocky Linux $releasever - Plus -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=rockyplus-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/plus/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-PowerTools.repo <<\EOF -# Rocky-PowerTools.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[powertools] -name=Rocky Linux $releasever - PowerTools -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=PowerTools-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/PowerTools/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-ResilientStorage.repo <<\EOF -# Rocky-ResilientStorage.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[resilient-storage] -name=Rocky Linux $releasever - ResilientStorage -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-RT.repo <<\EOF -# Rocky-RT.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[rt] -name=Rocky Linux $releasever - Realtime -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/RT/$basearch/os/ -gpgcheck=1 -enabled=0 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - cat >$Dir_RedHatRepos/Rocky-Sources.repo <<\EOF -# Rocky-Sources.repo - -[baseos-source] -name=Rocky Linux $releasever - BaseOS - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=BaseOS-$releasever-source -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/source/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[appstream-source] -name=Rocky Linux $releasever - AppStream - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=AppStream-$releasever-source -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/source/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -#[extras-source] -#name=Rocky Linux $releasever - Extras - Source -#mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=extras-$releasever-source -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/source/tree/ -#gpgcheck=1 -#enabled=0 -#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -#[plus-source] -#name=Rocky Linux $releasever - Plus - Source -#mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=plus-$releasever-source -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/Plus/source/tree/ -#gpgcheck=1 -#enabled=0 -#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[ha-source] -name=Rocky Linux $releasever - High Availability - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=HighAvailability-$releasever-source -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/source/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[powertools-source] -name=Rocky Linux $releasever - PowerTools - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=PowerTools-$releasever-source -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/PowerTools/source/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial - -[resilient-storage-source] -name=Rocky Linux $releasever - Resilient Storage - Source -mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=ResilientStorage-$releasever-source -#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/source/tree/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial -EOF - ;; - esac -} - -## 生成 AlmaLinux 官方 repo 源文件 -function GenRepoFiles_AlmaLinux() { - case $1 in - 9) - cat >$Dir_RedHatRepos/almalinux-appstream.repo <<\EOF -[appstream] -name=AlmaLinux $releasever - AppStream -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream -# baseurl=https://repo.almalinux.org/almalinux/$releasever/AppStream/$basearch/os/ -enabled=1 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=1 - -[appstream-debug] -name=AlmaLinux $releasever - AppStream - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/AppStream/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[appstream-source] -name=AlmaLinux $releasever - AppStream - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-source -# baseurl=https://repo.almalinux.org/vault/$releasever/AppStream/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-baseos.repo <<\EOF -[baseos] -name=AlmaLinux $releasever - BaseOS -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos -# baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/ -enabled=1 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=1 - -[baseos-debug] -name=AlmaLinux $releasever - BaseOS - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/BaseOS/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[baseos-source] -name=AlmaLinux $releasever - BaseOS - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-source -# baseurl=https://repo.almalinux.org/vault/$releasever/BaseOS/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-crb.repo <<\EOF -[crb] -name=AlmaLinux $releasever - CRB -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/crb -# baseurl=https://repo.almalinux.org/almalinux/$releasever/CRB/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[crb-debug] -name=AlmaLinux $releasever - CRB - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/crb-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/CRB/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[crb-source] -name=AlmaLinux $releasever - CRB - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/crb-source -# baseurl=https://repo.almalinux.org/vault/$releasever/CRB/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-extras.repo <<\EOF -[extras] -name=AlmaLinux $releasever - Extras -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras -# baseurl=https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/ -enabled=1 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[extras-debug] -name=AlmaLinux $releasever - Extras - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/extras/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[extras-source] -name=AlmaLinux $releasever - Extras - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras-source -# baseurl=https://repo.almalinux.org/vault/$releasever/extras/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-highavailability.repo <<\EOF -[highavailability] -name=AlmaLinux $releasever - HighAvailability -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability -# baseurl=https://repo.almalinux.org/almalinux/$releasever/HighAvailability/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[highavailability-debug] -name=AlmaLinux $releasever - HighAvailability - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/HighAvailability/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[highavailability-source] -name=AlmaLinux $releasever - HighAvailability - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability-source -# baseurl=https://repo.almalinux.org/vault/$releasever/HighAvailability/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-nfv.repo <<\EOF -[nfv] -name=AlmaLinux $releasever - NFV -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv -# baseurl=https://repo.almalinux.org/almalinux/$releasever/NFV/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[nfv-debug] -name=AlmaLinux $releasever - NFV - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/NFV/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[nfv-source] -name=AlmaLinux $releasever - NFV - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv-source -# baseurl=https://repo.almalinux.org/vault/$releasever/NFV/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-plus.repo <<\EOF -[plus] -name=AlmaLinux $releasever - Plus -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus -# baseurl=https://repo.almalinux.org/almalinux/$releasever/plus/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[plus-debug] -name=AlmaLinux $releasever - Plus - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/plus/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[plus-source] -name=AlmaLinux $releasever - Plus - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus-source -# baseurl=https://repo.almalinux.org/vault/$releasever/plus/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-resilientstorage.repo <<\EOF -[resilientstorage] -name=AlmaLinux $releasever - ResilientStorage -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage -# baseurl=https://repo.almalinux.org/almalinux/$releasever/ResilientStorage/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[resilientstorage-debug] -name=AlmaLinux $releasever - ResilientStorage - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/ResilientStorage/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[resilientstorage-source] -name=AlmaLinux $releasever - ResilientStorage - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-source -# baseurl=https://repo.almalinux.org/vault/$releasever/ResilientStorage/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-rt.repo <<\EOF -[rt] -name=AlmaLinux $releasever - RT -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt -# baseurl=https://repo.almalinux.org/almalinux/$releasever/RT/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[rt-debug] -name=AlmaLinux $releasever - RT - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/RT/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[rt-source] -name=AlmaLinux $releasever - RT - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt-source -# baseurl=https://repo.almalinux.org/vault/$releasever/RT/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-sap.repo <<\EOF -[sap] -name=AlmaLinux $releasever - SAP -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap -# baseurl=https://repo.almalinux.org/almalinux/$releasever/SAP/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[sap-debug] -name=AlmaLinux $releasever - SAP - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/SAP/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[sap-source] -name=AlmaLinux $releasever - SAP - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap-source -# baseurl=https://repo.almalinux.org/vault/$releasever/SAP/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - cat >$Dir_RedHatRepos/almalinux-saphana.repo <<\EOF -[saphana] -name=AlmaLinux $releasever - SAPHANA -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana -# baseurl=https://repo.almalinux.org/almalinux/$releasever/SAPHANA/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[saphana-debug] -name=AlmaLinux $releasever - SAPHANA - Debug -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana-debug -# baseurl=https://repo.almalinux.org/vault/$releasever/SAPHANA/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 - -[saphana-source] -name=AlmaLinux $releasever - SAPHANA - Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana-source -# baseurl=https://repo.almalinux.org/vault/$releasever/SAPHANA/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 -metadata_expire=86400 -enabled_metadata=0 -EOF - ;; - 8) - cat >$Dir_RedHatRepos/almalinux-ha.repo <<\EOF -# almalinux-ha.repo - -[ha] -name=AlmaLinux $releasever - HighAvailability -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/ha -# baseurl=https://repo.almalinux.org/almalinux/$releasever/HighAvailability/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[ha-source] -name=AlmaLinux $releasever - HighAvailability Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/ha-source -# baseurl=https://repo.almalinux.org/vault/$releasever/HighAvailability/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[ha-debuginfo] -name=AlmaLinux $releasever - HighAvailability debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/ha-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/HighAvailability/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux-nfv.repo <<\EOF -# almalinux-nfv.repo - -[nfv] -name=AlmaLinux $releasever - Real Time for NFV -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv -# baseurl=https://repo.almalinux.org/almalinux/$releasever/NFV/$basearch/os/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[nfv-source] -name=AlmaLinux $releasever - Real Time for NFV Sources -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv-source -# baseurl=https://repo.almalinux.org/vault/$releasever/NFV/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[nfv-debuginfo] -name=AlmaLinux $releasever - Real Time for NFV Debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/NFV/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux-plus.repo <<\EOF -# almalinux-plus.repo - -[plus] -name=AlmaLinux $releasever - Plus -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus -# baseurl=https://repo.almalinux.org/almalinux/$releasever/plus/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[plus-source] -name=AlmaLinux $releasever - Plus Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus-source -# baseurl=https://repo.almalinux.org/vault/$releasever/plus/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[plus-debuginfo] -name=AlmaLinux $releasever - Plus debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/plus/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux-powertools.repo <<\EOF -# almalinux-powertools.repo - -[powertools] -name=AlmaLinux $releasever - PowerTools -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/powertools -# baseurl=https://repo.almalinux.org/almalinux/$releasever/PowerTools/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[powertools-source] -name=AlmaLinux $releasever - PowerTools Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/powertools-source -# baseurl=https://repo.almalinux.org/vault/$releasever/PowerTools/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[powertools-debuginfo] -name=AlmaLinux $releasever - PowerTools debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/powertools-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/PowerTools/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux-resilientstorage.repo <<\EOF -# almalinux-resilientstorage.repo - -[resilientstorage] -name=AlmaLinux $releasever - ResilientStorage -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage -# baseurl=https://repo.almalinux.org/almalinux/$releasever/ResilientStorage/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[resilientstorage-source] -name=AlmaLinux $releasever - ResilientStorage Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-source -# baseurl=https://repo.almalinux.org/vault/$releasever/ResilientStorage/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[resilientstorage-debuginfo] -name=AlmaLinux $releasever - ResilientStorage debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/ResilientStorage/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux-rt.repo <<\EOF -# almalinux-rt.repo - -[rt] -name=AlmaLinux $releasever - Real Time -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt -# baseurl=https://repo.almalinux.org/almalinux/$releasever/RT/$basearch/os/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[rt-source] -name=AlmaLinux $releasever - Real Time Sources -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt-source -# baseurl=https://repo.almalinux.org/vault/$releasever/RT/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[rt-debuginfo] -name=AlmaLinux $releasever - Real Time Debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/RT/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux-sap.repo <<\EOF -# almalinux-sap.repo - -[sap] -name=AlmaLinux $releasever - SAP -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap -# baseurl=https://repo.almalinux.org/almalinux/$releasever/SAP/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[sap-source] -name=AlmaLinux $releasever - SAP Sources -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap-source -# baseurl=https://repo.almalinux.org/vault/$releasever/SAP/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[sap-debuginfo] -name=AlmaLinux $releasever - SAP Debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/SAP/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux-saphana.repo <<\EOF -# almalinux-saphana.repo - -[saphana] -name=AlmaLinux $releasever - SAP HANA -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana -# baseurl=https://repo.almalinux.org/almalinux/$releasever/SAPHANA/$basearch/os/ -enabled=0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[saphana-source] -name=AlmaLinux $releasever - SAP HANA Sources -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana-source -# baseurl=https://repo.almalinux.org/vault/$releasever/SAPHANA/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[saphana-debuginfo] -name=AlmaLinux $releasever - SAP HANA Debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/SAPHANA/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - cat >$Dir_RedHatRepos/almalinux.repo <<\EOF -# almalinux.repo - -[baseos] -name=AlmaLinux $releasever - BaseOS -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos -# baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/ -enabled=1 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -[appstream] -name=AlmaLinux $releasever - AppStream -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream -# baseurl=https://repo.almalinux.org/almalinux/$releasever/AppStream/$basearch/os/ -enabled=1 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -[extras] -name=AlmaLinux $releasever - Extras -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras -# baseurl=https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/ -enabled=1 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Sources -[baseos-source] -name=AlmaLinux $releasever - BaseOS Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-source -# baseurl=https://repo.almalinux.org/vault/$releasever/BaseOS/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -[appstream-source] -name=AlmaLinux $releasever - AppStream Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-source -# baseurl=https://repo.almalinux.org/vault/$releasever/AppStream/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -[extras-source] -name=AlmaLinux $releasever - Extras Source -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras-source -# baseurl=https://repo.almalinux.org/vault/$releasever/extras/Source/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -## Debuginfo -[baseos-debuginfo] -name=AlmaLinux $releasever - BaseOS debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/BaseOS/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -[appstream-debuginfo] -name=AlmaLinux $releasever - AppStream debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/AppStream/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux - -[extras-debuginfo] -name=AlmaLinux $releasever - Extras debuginfo -mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras-debuginfo -# baseurl=https://repo.almalinux.org/vault/$releasever/extras/debug/$basearch/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux -EOF - ;; - esac -} - -## 生成 Fedora 官方 repo 源文件 -function GenRepoFiles_Fedora() { - cat >$Dir_RedHatRepos/fedora-cisco-openh264.repo <<\EOF -[fedora-cisco-openh264] -name=Fedora $releasever openh264 (From Cisco) - $basearch -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-$releasever&arch=$basearch -type=rpm -enabled=1 -metadata_expire=14d -repo_gpgcheck=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=True - -[fedora-cisco-openh264-debuginfo] -name=Fedora $releasever openh264 (From Cisco) - $basearch - Debug -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-debug-$releasever&arch=$basearch -type=rpm -enabled=0 -metadata_expire=14d -repo_gpgcheck=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=True -EOF - cat >$Dir_RedHatRepos/fedora.repo <<\EOF -[fedora] -name=Fedora $releasever - $basearch -#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch -enabled=1 -countme=1 -metadata_expire=7d -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[fedora-debuginfo] -name=Fedora $releasever - $basearch - Debug -#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/tree/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch -enabled=0 -metadata_expire=7d -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[fedora-source] -name=Fedora $releasever - Source -#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/source/tree/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch -enabled=0 -metadata_expire=7d -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False -EOF - cat >$Dir_RedHatRepos/fedora-updates.repo <<\EOF -[updates] -name=Fedora $releasever - $basearch - Updates -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/$basearch/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch -enabled=1 -countme=1 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-debuginfo] -name=Fedora $releasever - $basearch - Updates - Debug -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/$basearch/debug/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-source] -name=Fedora $releasever - Updates Source -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/SRPMS/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False -EOF - cat >$Dir_RedHatRepos/fedora-modular.repo <<\EOF -[fedora-modular] -name=Fedora Modular $releasever - $basearch -#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Modular/$basearch/os/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-$releasever&arch=$basearch -enabled=1 -countme=1 -#metadata_expire=7d -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[fedora-modular-debuginfo] -name=Fedora Modular $releasever - $basearch - Debug -#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Modular/$basearch/debug/tree/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-debug-$releasever&arch=$basearch -enabled=0 -metadata_expire=7d -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[fedora-modular-source] -name=Fedora Modular $releasever - Source -#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Modular/source/tree/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-source-$releasever&arch=$basearch -enabled=0 -metadata_expire=7d -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False -EOF - cat >$Dir_RedHatRepos/fedora-updates-modular.repo <<\EOF -[updates-modular] -name=Fedora Modular $releasever - $basearch - Updates -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Modular/$basearch/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-modular-f$releasever&arch=$basearch -enabled=1 -countme=1 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-modular-debuginfo] -name=Fedora Modular $releasever - $basearch - Updates - Debug -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Modular/$basearch/debug/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-modular-debug-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-modular-source] -name=Fedora Modular $releasever - Updates Source -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Modular/SRPMS/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-modular-source-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False -EOF - cat >$Dir_RedHatRepos/fedora-updates-testing.repo <<\EOF -[updates-testing] -name=Fedora $releasever - $basearch - Test Updates -#baseurl=http://download.example/pub/fedora/linux/updates/testing/$releasever/Everything/$basearch/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch -enabled=0 -countme=1 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-testing-debuginfo] -name=Fedora $releasever - $basearch - Test Updates Debug -#baseurl=http://download.example/pub/fedora/linux/updates/testing/$releasever/Everything/$basearch/debug/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-debug-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-testing-source] -name=Fedora $releasever - Test Updates Source -#baseurl=http://download.example/pub/fedora/linux/updates/testing/$releasever/Everything/SRPMS/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-source-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False -EOF - cat >$Dir_RedHatRepos/fedora-updates-testing-modular.repo <<\EOF -[updates-testing-modular] -name=Fedora Modular $releasever - $basearch - Test Updates -#baseurl=http://download.example/pub/fedora/linux/updates/testing/$releasever/Modular/$basearch/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-modular-f$releasever&arch=$basearch -enabled=0 -countme=1 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-testing-modular-debuginfo] -name=Fedora Modular $releasever - $basearch - Test Updates Debug -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Modular/$basearch/debug/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-modular-debug-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False - -[updates-testing-modular-source] -name=Fedora Modular $releasever - Test Updates Source -#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Modular/SRPMS/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-modular-source-f$releasever&arch=$basearch -enabled=0 -repo_gpgcheck=0 -type=rpm -gpgcheck=1 -metadata_expire=6h -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch -skip_if_unavailable=False -EOF -} - -## 生成 openSUSE 官方 repo 源文件 -function GenRepoFiles_openSUSE() { - case $1 in - "leap") - case $2 in - 15.[0-2]) - cat >$Dir_openSUSERepos/repo-debug-non-oss.repo <<\EOF -[repo-debug-non-oss] -name=Debug Repository (Non-OSS) -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/distribution/leap/$releasever/repo/non-oss/ -type=NONE -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-debug.repo <<\EOF -[repo-debug] -name=Debug Repository -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/distribution/leap/$releasever/repo/oss/ -type=NONE -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-debug-update-non-oss.repo <<\EOF -[repo-debug-update-non-oss] -name=Update Repository (Debug, Non-OSS) -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/update/leap/$releasever/non-oss/ -type=NONE -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-debug-update.repo <<\EOF -[repo-debug-update] -name=Update Repository (Debug) -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/update/leap/$releasever/oss/ -type=NONE -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-non-oss.repo <<\EOF -[repo-non-oss] -name=Non-OSS Repository -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/non-oss/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-oss.repo <<\EOF -[repo-oss] -name=Main Repository -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/oss/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-source-non-oss.repo <<\EOF -[repo-source-non-oss] -name=Source Repository (Non-OSS) -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/source/distribution/leap/$releasever/repo/non-oss/ -type=NONE -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-source.repo <<\EOF -[repo-source] -name=Source Repository -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/source/distribution/leap/$releasever/repo/oss/ -type=NONE -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-update-non-oss.repo <<\EOF -[repo-update-non-oss] -name=Update Repository (Non-Oss) -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/update/leap/$releasever/non-oss/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-update.repo <<\EOF -[repo-update] -name=Main Update Repository -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/update/leap/$releasever/oss/ -type=rpm-md -keeppackages=0 -EOF - ;; - *) - cat >$Dir_openSUSERepos/repo-backports-debug-update.repo <<\EOF -[repo-backports-debug-update] -name=Update repository with updates for openSUSE Leap debuginfo packages from openSUSE Backports -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/update/leap/$releasever/backports_debug/ -type=NONE -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-backports-update.repo <<\EOF -[repo-backports-update] -name=Update repository of openSUSE Backports -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/update/leap/$releasever/backports/ -path=/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-debug-non-oss.repo <<\EOF -[repo-debug-non-oss] -name=Debug Repository (Non-OSS) -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/distribution/leap/$releasever/repo/non-oss/ -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-debug.repo <<\EOF -[repo-debug] -name=Debug Repository -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/distribution/leap/$releasever/repo/oss/ -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-debug-update-non-oss.repo <<\EOF -[repo-debug-update-non-oss] -name=Update Repository (Debug, Non-OSS) -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/update/leap/$releasever/non-oss/ -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-debug-update.repo <<\EOF -[repo-debug-update] -name=Update Repository (Debug) -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/update/leap/$releasever/oss/ -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-non-oss.repo <<\EOF -[repo-non-oss] -name=Non-OSS Repository -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/non-oss/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-oss.repo <<\EOF -[repo-oss] -name=Main Repository -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/oss/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-sle-debug-update.repo <<\EOF -[repo-sle-debug-update] -name=Update repository with debuginfo for updates from SUSE Linux Enterprise 15 -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/update/leap/$releasever/sle/ -path=/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-sle-update.repo <<\EOF -[repo-sle-update] -name=Update repository with updates from SUSE Linux Enterprise 15 -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/update/leap/$releasever/sle/ -path=/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-source.repo <<\EOF -[repo-source] -name=Source Repository -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/source/distribution/leap/$releasever/repo/oss/ -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-update-non-oss.repo <<\EOF -[repo-update-non-oss] -name=Update Repository (Non-Oss) -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/update/leap/$releasever/non-oss/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-update.repo <<\EOF -[repo-update] -name=Main Update Repository -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/update/leap/$releasever/oss/ -type=rpm-md -keeppackages=0 -EOF - ;; - esac - ;; - "tumbleweed") - cat >$Dir_openSUSERepos/repo-debug.repo <<\EOF -[repo-debug] -name=openSUSE-Tumbleweed-Debug -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/debug/tumbleweed/repo/oss/ -path=/ -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-non-oss.repo <<\EOF -[repo-non-oss] -name=openSUSE-Tumbleweed-Non-Oss -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/tumbleweed/repo/non-oss/ -path=/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-openh264.repo <<\EOF -[repo-openh264] -name=Open H.264 Codec (openSUSE Tumbleweed) -enabled=1 -autorefresh=1 -baseurl=http://codecs.opensuse.org/openh264/openSUSE_Tumbleweed -path=/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-oss.repo <<\EOF -[repo-oss] -name=openSUSE-Tumbleweed-Oss -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/tumbleweed/repo/oss/ -path=/ -type=rpm-md -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-source.repo <<\EOF -[repo-source] -name=openSUSE-Tumbleweed-Source -enabled=0 -autorefresh=1 -baseurl=http://download.opensuse.org/source/tumbleweed/repo/oss/ -path=/ -keeppackages=0 -EOF - cat >$Dir_openSUSERepos/repo-update.repo <<\EOF -[repo-update] -name=openSUSE-Tumbleweed-Update -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/update/tumbleweed/ -path=/ -type=rpm-md -keeppackages=0 -EOF - ;; - esac -} - -## 处理命令选项 -function CommandOptions() { - ## 命令帮助 - function Output_Help_Info() { - echo -e " -选项命令(参数名/含义/参数值): - - --source 指定软件源地址 地址 - --source-security 指定 debian-security 软件源地址 地址 - --source-vault 指定 centos-vault 软件源地址 地址 - --branch 指定软件源分支(路径) 分支名 - --branch-security 指定 debian-security 软件源分支(路径) 分支名 - --branch-vault 指定 centos-vault 软件源分支(路径) 分支名 - --web-protocol 指定 WEB 协议 http 或 https - --backup 备份原有软件源 true 或 false - --ignore-backup-tips 忽略覆盖备份提示 无 - --print-diff 打印源文件修改前后差异 无 - - " - } - - ## 判断参数 - while [ $# -gt 0 ]; do - case $1 in - ## 指定软件源地址 - --source) - if [ $2 ]; then - echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" - if [ $? -eq 0 ]; then - Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" - else - SOURCE="$2" - shift - fi - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定软件源地址!" - fi - ;; - --source-security) - if [ $2 ]; then - echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" - if [ $? -eq 0 ]; then - Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" - else - SOURCE_SECURITY="$2" - shift - fi - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定软件源地址!" - fi - ;; - --source-vault) - if [ $2 ]; then - echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" - if [ $? -eq 0 ]; then - Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" - else - SOURCE_VAULT="$2" - shift - fi - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定软件源地址!" - fi - ;; - ## 指定软件源分支 - --branch) - if [ $2 ]; then - SOURCE_BRANCH="$2" - shift - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定软件源地址!" - fi - ;; - --branch-security) - if [ $2 ]; then - SOURCE_BRANCH_SECURITY="$2" - shift - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定软件源地址!" - fi - ;; - --branch-vault) - if [ $2 ]; then - SOURCE_BRANCH_VAULT="$2" - shift - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定软件源地址!" - fi - ;; - ## WEB 协议(HTTP/HTTPS) - --web-protocol) - if [ $2 ]; then - case $2 in - http | https | HTTP | HTTPS) - WEB_PROTOCOL="$2" - shift - ;; - *) - Output_Error "检测到 ${BLUE}$2${PLAIN} 为无效参数值,请在该参数后指定 http 或 https 作为参数值!" - ;; - esac - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定 WEB 协议(HTTP/HTTPS)!" - fi - ;; - ## 备份原有软件源 - --backup) - if [ $2 ]; then - case $2 in - [Tt]rue | [Ff]alse) - BACKUP="${2,,}" - shift - ;; - *) - Output_Error "检测到 ${BLUE}$2${PLAIN} 为无效参数值,请在该参数后指定 true 或 false 作为参数值!" - ;; - esac - else - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请在该参数后指定 true 或 false 作为参数值!" - fi - ;; - ## 忽略覆盖备份提示 - --ignore-backup-tips) - IGNORE_BACKUP_TIPS="true" - ;; - ## 打印源文件修改前后差异 - --print-diff) - PRINT_DIFF="true" - ;; - --help) - Output_Help_Info - exit - ;; - *) - Output_Error "检测到 ${BLUE}$1${PLAIN} 为无效参数,请确认后重新输入!" - ;; - esac - shift - done - ## 赋予部分命令参数默认值 - BACKUP="${BACKUP:-"true"}" - IGNORE_BACKUP_TIPS="${IGNORE_BACKUP_TIPS:-"false"}" - PRINT_DIFF="${PRINT_DIFF:-"false"}" -} - -## 组合函数 -function Combin_Function() { - PermissionJudgment - EnvJudgment - CheckCommandOptions - StartTitle - ChooseMirrors - ChooseWebProtocol - UserConfirm - BackupOriginMirrors - RemoveOriginMirrors - ChangeMirrors -} - -CommandOptions "$@" -Combin_Function diff --git a/README.md b/README.md index 37ae962..b34624d 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,6 @@ Material for MkDocs

-

- - 官方网站 - -

GNU/Linux 一键更换系统软件源脚本 @@ -15,69 +10,73 @@

- 本项目旨在为从事计算机相关行业的朋友们提供便利 + 官方网站

-- ### 适配系统及其版本 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +








+
 Debian8.0 ~ 12
 Ubuntu14.04 ~ 23
 Kali Linux2.0 ~ 2023
 Red Hat Enterprise Linux7.0 ~ 9
 Fedora30 ~ 38
 CentOS7.0 ~ 8.5 / Stream 8 ~ 9
 Rocky Linux8.0 ~ 9
 AlmaLinux8.0 ~ 9
 OpenCloudOS8.0 ~ 9
 openEuler21.03 ~ 23
 openSUSELeep 15 / Tumbleweed
 Arch Linuxall
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
支持
版本
-
 Debian8.0 ~ 12
 Ubuntu14.04 ~ 23
 Kali Linux2.0 ~ 2023
 Red Hat Enterprise Linux7.0 ~ 9
 CentOS7.0 ~ 8.5 / Stream 8 ~ 9
 Rocky Linux8.0 ~ 9
 AlmaLinux8.0 ~ 9
 Fedora30 ~ 38
 openEuler21.03 ~ 23
 openSUSELeep 15 / Tumbleweed
 Arch Linuxall
- -- ### [软件源](https://linuxmirrors.cn/mirrors) -- ### [使用方法](https://linuxmirrors.cn/use) -- ### [常见问题](https://linuxmirrors.cn/help) -- ### [其它脚本](https://linuxmirrors.cn/other) +- #### [软件源](https://linuxmirrors.cn/mirrors) +- #### [使用方法](https://linuxmirrors.cn/use) +- #### [常见问题](https://linuxmirrors.cn/help) +- #### [其它脚本](https://linuxmirrors.cn/other) *** +这是一个完全开源的非盈利项目,旨在为从事计算机相关行业的朋友们提供便利,让还源更简单 + ### LICENSE Copyright © 2023, [SuperManito](https://github.com/SuperManito). Released under the [MIT](https://github.com/SuperManito/LinuxMirrors/blob/main/LICENSE). diff --git a/docs/assets/images/icon/opencloudos.png b/docs/assets/images/icon/opencloudos.png new file mode 100644 index 0000000000000000000000000000000000000000..ee1dc0782339922d85b97280368b64d0acda3c7d GIT binary patch literal 716 zcmV;-0yF)IP)|dkHbOL zf=p1$KT_FFAi46seiead3($v?2nPrX(HYl*@s)#uZ2p-qHC~FMS)Duo z!8E$luGgi6ZOf_09>IY+J&U3UvJhJ$g4QmeGZhcjW#D=&U(DFIRgf>K)6s|5!q4xd zX_Y|RgCPds(G~zbXP3(BgI2B<+{gn5*s;xBkh-EPE;xWlY= z1B!b)7OgtrHq0Lm+Hi=Ba1dFIJ#sGe?JGpCjlu^N4xH4ZV;>7w)z@~Z9J_`|-+@K5 zw()7=N#MEQVRBheBmJI_gLi;Mw@-p5P3r{cb3taErs!{b`O+4rPo7GH6T)k~rE(`% z0DvjeLeZ @@ -32,6 +34,10 @@ GNU/Linux 一键更换系统软件源脚本 · 让换源更简单  Red Hat Enterprise Linux 7.0 ~ 9 + +  Fedora + 30 ~ 38 +  CentOS 7.0 ~ 8.5 / Stream 8 ~ 9 @@ -45,8 +51,8 @@ GNU/Linux 一键更换系统软件源脚本 · 让换源更简单 8.0 ~ 9 -  Fedora - 30 ~ 38 +  OpenCloudOS + 8.0 ~ 9  openEuler diff --git a/docs/mirrors.md b/docs/mirrors.md index 2b299ab..e7a4c1d 100644 --- a/docs/mirrors.md +++ b/docs/mirrors.md @@ -6,37 +6,37 @@ hide: ## 中国大陆 :flag-CN: -| | 镜像站名称 | 镜像站地址 | IPv6 | Kali | Rocky | AlmaLinux | EPEL | Fedora | openEuler | openSUSE | +| | 镜像站名称 | 镜像站地址 | IPv6 | Kali | Rocky | AlmaLinux | EPEL | Fedora | openEuler | OpenCloudOS | | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | -| 1 | 阿里云 | [mirrors.aliyun.com](https://developer.aliyun.com/mirror) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-circle-off-outline:{ style="color: #F6B604" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 2 | 腾讯云 | [mirrors.tencent.com](https://mirrors.tencent.com) | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 3 | 华为云 | [mirrors.huaweicloud.com](https://mirrors.huaweicloud.com) | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-circle-off-outline:{ style="color: #F6B604" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 4 | 网易 | [mirrors.163.com](https://mirrors.163.com) | :material-close:{ style="color: #EF5350" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-circle-off-outline:{ style="color: #F6B604" } | -| 5 | 搜狐 | [mirrors.sohu.com](https://mirrors.sohu.com) | :material-close:{ style="color: #EF5350" } | :material-close:{ style="color: #EF5350" } | :material-circle-off-outline:{ style="color: #F6B604" } | :material-close:{ style="color: #EF5350" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | -| 6 | 清华大学 | [mirrors.tuna.tsinghua.edu.cn](https://mirrors.tuna.tsinghua.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 7 | 北京大学 | [mirrors.pku.edu.cn](https://mirrors.pku.edu.cn/Mirrors) | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-close:{ style="color: #EF5350" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 8 | 浙江大学 | [mirrors.zju.edu.cn](https://mirrors.zju.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 9 | 南京大学 | [mirrors.nju.edu.cn](https://mirrors.nju.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 10 | 重庆大学 | [mirrors.cqu.edu.cn](https://mirrors.cqu.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-circle-off-outline:{ style="color: #F6B604" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | -| 11 | 兰州大学 | [mirror.lzu.edu.cn](https://mirror.lzu.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 12 | 上海交通大学 | [mirror.sjtu.edu.cn](https://mirror.sjtu.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 13 | 哈尔滨工业大学 | [mirrors.hit.edu.cn](https://mirrors.hit.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 14 | 中国科学技术大学 | [mirrors.ustc.edu.cn](https://mirrors.ustc.edu.cn) | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | -| 15 | 中国科学院软件研究所 | [mirror.iscas.ac.cn](https://mirror.iscas.ac.cn) | :material-close:{ style="color: #EF5350" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | +| 1 | 阿里云 | [mirrors.aliyun.com](https://developer.aliyun.com/mirror) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-circle-off-outline:{style="color: #F6B604"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 2 | 腾讯云 | [mirrors.tencent.com](https://mirrors.tencent.com) | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | +| 3 | 华为云 | [mirrors.huaweicloud.com](https://mirrors.huaweicloud.com) | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-circle-off-outline:{style="color: #F6B604"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 4 | 网易 | [mirrors.163.com](https://mirrors.163.com) | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 5 | 搜狐 | [mirrors.sohu.com](https://mirrors.sohu.com) | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | :material-circle-off-outline:{style="color: #F6B604"} | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | +| 6 | 清华大学 | [mirrors.tuna.tsinghua.edu.cn](https://mirrors.tuna.tsinghua.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 7 | 北京大学 | [mirrors.pku.edu.cn](https://mirrors.pku.edu.cn/Mirrors) | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | +| 8 | 浙江大学 | [mirrors.zju.edu.cn](https://mirrors.zju.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 9 | 南京大学 | [mirrors.nju.edu.cn](https://mirrors.nju.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 10 | 重庆大学 | [mirrors.cqu.edu.cn](https://mirrors.cqu.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-circle-off-outline:{style="color: #F6B604"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-close:{style="color: #EF5350"} | +| 11 | 兰州大学 | [mirror.lzu.edu.cn](https://mirror.lzu.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 12 | 上海交通大学 | [mirror.sjtu.edu.cn](https://mirror.sjtu.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | +| 13 | 哈尔滨工业大学 | [mirrors.hit.edu.cn](https://mirrors.hit.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 14 | 中国科学技术大学 | [mirrors.ustc.edu.cn](https://mirrors.ustc.edu.cn) | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | +| 15 | 中国科学院软件研究所 | [mirror.iscas.ac.cn](https://mirror.iscas.ac.cn) | :material-close:{style="color: #EF5350"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-check:{style="color: #4DB6AC"} | :material-close:{style="color: #EF5350"} | -上述列表中的镜像站均支持 `Debian` `Ubuntu` `CentOS` `Arch Linux` 软件源,列表根据单位性质、地理位置、名称长度进行排序与实际速度无关,目前没有扩充计划 +上述列表中的镜像站均支持 `Debian` `Ubuntu` `CentOS` `openSUSE` `Arch Linux` 软件源,列表根据单位性质、地理位置、名称长度进行排序与实际速度无关,目前没有扩充计划 !!! question "使用帮助" - :material-check:{ style="color: #4DB6AC" } 支持    :material-close:{ style="color: #EF5350" } 不支持    :material-circle-off-outline:{ style="color: #F6B604" } 表示软件源分支命名不符合脚本默认规则,但可以通过命令参数来使用,具体详见[用法示例](../use/command-options/#%E6%8C%87%E5%AE%9A%E8%BD%AF%E4%BB%B6%E6%BA%90%E5%88%86%E6%94%AF),关于针对各操作系统所默认使用的镜像站分支名称[详见此处](../use/command-options/#%E6%8C%87%E5%AE%9A%E8%BD%AF%E4%BB%B6%E6%BA%90%E5%88%86%E6%94%AF) + :material-check:{style="color: #4DB6AC"} 支持    :material-close:{style="color: #EF5350"} 不支持    :material-circle-off-outline:{style="color: #F6B604"} 表示软件源分支命名不符合脚本默认规则,但可以通过命令参数来使用,具体详见[用法示例](../use/command-options/#%E6%8C%87%E5%AE%9A%E8%BD%AF%E4%BB%B6%E6%BA%90%E5%88%86%E6%94%AF),关于各操作系统针对软件源(镜像站)所使用的默认分支名称[详见此处](../use/command-options/#%E6%8C%87%E5%AE%9A%E8%BD%AF%E4%BB%B6%E6%BA%90%E5%88%86%E6%94%AF) - 如果使用脚本过程中不能正常输出中文内容则可对照此列表使用,顺序与脚本一致,之后一路回车即可,如果这里没有你想使用的教育单位镜像站,那么你可以运行[中国大陆教育网专用版本](/use/#%E4%B8%AD%E5%9B%BD%E5%A4%A7%E9%99%86%E6%95%99%E8%82%B2%E7%BD%91%E5%AE%9E%E9%AA%8C%E6%80%A7)看看 + 如果使用脚本过程中不能正常输出中文内容则可对照此列表使用,顺序与脚本一致,之后一路回车即可。如果这里没有你想使用的教育单位镜像站,那么你可以使用[国内教育网模式](/use/#%E5%9B%BD%E5%86%85%E6%95%99%E8%82%B2%E7%BD%91%E4%BD%BF%E7%94%A8)看看 ???+ abstract "使用建议" 软件源的速度区分刷新速度和下载速度,后者才是关键,具体请结合实际地理位置选择尝试,华北地区建议优先使用`中科大`、`腾讯云`镜像站,你可以使用下面提到的[辅助工具网站](#工具网站)来帮助你进行选择 - 目前不建议使用`阿里云`镜像站,由于使用人数过多其公网下行带宽已被限制在了10M左右。如果你的内网环境过于复杂例如经过了多次NAT转换那么请不要使用`清华大学(TUNA)`镜像站,容易被拉黑 + 目前不建议使用`阿里云`镜像站,由于使用人数过多其公网下行带宽已被限制在了10M左右。如果你的内网环境过于复杂例如经过了多次NAT转换那么请不要使用`清华大学(TUNA)`镜像站,容易被阻断 ## 海外地区 :flag-world-map: diff --git a/docs/other/index.md b/docs/other/index.md index b217135..5803094 100644 --- a/docs/other/index.md +++ b/docs/other/index.md @@ -10,7 +10,7 @@ hide: bash <(curl -sSL https://linuxmirrors.cn/docker.sh) ``` -!!! node "定义" +!!! node "" `Docker CE` 软件镜像仓库,全称 Docker Community Edition ,用于下载并安装 Docker 相关软件包。 `Docker Hub` 容器镜像仓库,默认为官方提供的公共库,用于控制下载镜像的来源存储仓库,又称镜像加速器。 diff --git a/docs/use/command-options.md b/docs/use/command-options.md index d5a6b1c..4f030ec 100644 --- a/docs/use/command-options.md +++ b/docs/use/command-options.md @@ -1,12 +1,13 @@ | 名称 | 含义 | 选项值 | | :-: | :-: | :-: | | `--source` | 指定软件源地址 | 地址 | -| `--source-security` | 指定 debian-security 软件源地址 | 地址 | -| `--source-vault` | 指定 centos-vault 软件源地址 | 地址 | +| `--source-security` | 指定 debian 的 security 软件源地址 | 地址 | +| `--source-vault` | 指定 centos/almalinux 的 vault 软件源地址 | 地址 | | `--branch` | 指定软件源分支(路径) | 分支名 | -| `--branch-security` | 指定 debian-security 软件源分支(路径) | 分支名 | -| `--branch-vault` | 指定 centos-vault 软件源分支(路径) | 分支名 | +| `--branch-security` | 指定 debian 的 security 软件源分支(路径) | 分支名 | +| `--branch-vault` | 指定 centos/almalinux 的 vault 软件源分支(路径) | 分支名 | | `--abroad` | 使用海外软件源 | 无 | +| `--abroad` | 使用中国大陆教育网软件源 | 无 | | `--web-protocol` | 指定 WEB 协议 | `http` 或 `https` | | `--intranet` | 优先使用内网地址 | `true` 或 `false` | | `--install-epel` | 安装 EPEL 附加软件包 | `true` 或 `false` | @@ -53,6 +54,10 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \  Red Hat Enterprise Linux centos/rocky + +  Fedora + fedora +  CentOS centos/centos-stream/centos-altarch/centos-vault @@ -63,11 +68,11 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \  AlmaLinux - almalinux + almalinux/almalinux-vault -  Fedora - fedora +  OpenCloudOS + opencloudos  openEuler diff --git a/docs/use/index.md b/docs/use/index.md index f80c06e..9f72773 100644 --- a/docs/use/index.md +++ b/docs/use/index.md @@ -13,12 +13,12 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --abroad ``` > 通过 `--abroad` 命令选项来使用海外软件源 -### 中国大陆教育网(实验性) +### 国内教育网使用 ``` bash -bash <(curl -sSL https://linuxmirrors.cn/edu.sh) +bash <(curl -sSL https://linuxmirrors.cn/main.sh) --edu ``` -> 针对中国教育单位的校园网定制,移除了部分功能,额外增加了一些操作确认提示 +> 通过 `--edu` 命令选项来使用中国教育单位软件源 ## 注意事项 @@ -30,14 +30,6 @@ bash <(curl -sSL https://linuxmirrors.cn/edu.sh) ??? quote "原始执行脚本方法" - === "国内使用(默认)" - - ``` bash - bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) - ``` - - === "海外使用" - - ``` bash - bash <(curl -sSL https://github.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) --abroad - ``` + ``` bash + bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) + ``` diff --git a/mkdocs.yml b/mkdocs.yml index bc17753..f48ab67 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,7 +2,7 @@ site_name: LinuxMirrors repo_name: SuperManito/LinuxMirrors repo_url: https://github.com/SuperManito/LinuxMirrors edit_uri: edit/main/docs/ -copyright: "Copyright © 2023 SuperManito. Website built with " +copyright: "Copyright © 2023 SuperManito. Website built with " theme: name: material custom_dir: docs/theme @@ -10,6 +10,7 @@ theme: favicon: assets/favicon.ico icon: logo: material/linux + repo: fontawesome/brands/github edit: material/file-document-edit-outline view: material/file-eye-outline admonition: @@ -28,16 +29,19 @@ theme: palette: # Palette toggle for light mode - scheme: default + primary: white toggle: - icon: material/brightness-7 + icon: material/brightness-7 name: Switch to dark mode # Palette toggle for dark mode - scheme: slate + primary: indigo toggle: icon: material/brightness-4 name: Switch to light mode features: - header.autohide + - navigation.top - navigation.tabs - navigation.path - navigation.instant