From b96a50c38d3d7c8977caab7e0405eb22c9fbaa11 Mon Sep 17 00:00:00 2001 From: Zhang Peng Date: Thu, 15 Mar 2018 17:43:59 +0800 Subject: [PATCH] =?UTF-8?q?:bookmark:=20change=20yum=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/deploy/sys/yum/change-yum-repo.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codes/deploy/sys/yum/change-yum-repo.sh b/codes/deploy/sys/yum/change-yum-repo.sh index b2af1d6..b6121a8 100644 --- a/codes/deploy/sys/yum/change-yum-repo.sh +++ b/codes/deploy/sys/yum/change-yum-repo.sh @@ -12,7 +12,8 @@ echo -e "\n>>>>>>>>> 替换 yum repo 源" cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak # 执行 lsb_release 命令,获取系统发行版本 -version=`lsb_release -r | awk '{print substr($2,1,1)}'` +# version=`lsb_release -r | awk '{print substr($2,1,1)}'` # 很多机器没有 lsb_release 命令 +version=`cat /etc/redhat-release | awk '{print substr($4,1,1)}'` # 根据发型版本选择相应 yum 镜像 if [ ${version} == 5 ]; then