Skip to content

Commit b96a50c

Browse files
committed
🔖 change yum 脚本
1 parent 60075f4 commit b96a50c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

codes/deploy/sys/yum/change-yum-repo.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ echo -e "\n>>>>>>>>> 替换 yum repo 源"
1212
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
1313

1414
# 执行 lsb_release 命令,获取系统发行版本
15-
version=`lsb_release -r | awk '{print substr($2,1,1)}'`
15+
# version=`lsb_release -r | awk '{print substr($2,1,1)}'` # 很多机器没有 lsb_release 命令
16+
version=`cat /etc/redhat-release | awk '{print substr($4,1,1)}'`
1617

1718
# 根据发型版本选择相应 yum 镜像
1819
if [ ${version} == 5 ]; then

0 commit comments

Comments
 (0)