From 2eb798ff2b7a03ae760fa37d2e47f5916463b4b5 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:29:58 +0800 Subject: [PATCH] fix(frame): fix dnf install use iaas mirror instead of official --- libs/locallibs/common_lib_shell.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/locallibs/common_lib_shell.sh b/libs/locallibs/common_lib_shell.sh index a033a1495f6..47df35a2a6f 100644 --- a/libs/locallibs/common_lib_shell.sh +++ b/libs/locallibs/common_lib_shell.sh @@ -101,11 +101,12 @@ function DNF_INSTALL() { if [[ location == "local" ]]; then reponames=$(grep '^\[.*\]' /etc/yum.repos.d/*.repo | tr -d [] | sed -e ':a;N;$!ba;s/\n/ /g') mapfile -t __install_pkgs < <(dnf --assumeno install ${__pkg_list[*]} 2>&1 | grep -wE "${reponames// /|}" | grep -wE "$(uname -m)|noarch" | awk '{print $1}') - dnf -y install ${__pkg_list[*]} - - if ! dnf -y install ${__pkg_list[*]}; then - LOG_ERROR "pkg_list:${__pkg_list[*]} install failed." - exit 1 + if ! dnf -y install --repo=mirror.iscas.ac.cn ${__pkg_list[*]}; then + LOG_WARN "Install with mirror.iscas.ac.cn failed, retrying with default repos." + if ! dnf -y install ${__pkg_list[*]}; then + LOG_ERROR "pkg_list:${__pkg_list[*]} install failed." + exit 1 + fi fi else remoteIp=$[ "NODE"$node"_IPV4" ]