diff --git a/xCAT/postscripts/ospkgs b/xCAT/postscripts/ospkgs index 1ecf66855..5a36e7c01 100755 --- a/xCAT/postscripts/ospkgs +++ b/xCAT/postscripts/ospkgs @@ -706,7 +706,7 @@ else result=`rm /etc/yum.repos.d/local-repository.repo 2>&1` fi rm /etc/yum.repos.d/$OSVER-path*.repo >/dev/null 2>&1 - result=`rm /etc/yum.repos.d/xCAT*.repo 2>&1` + result=`rm /etc/yum.repos.d/xCAT-$OSVER-path*.repo 2>&1` fi diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 256e7051f..df5f391c1 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -424,7 +424,9 @@ if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then old_repo=`zypper lr |grep -e "^[0-9]" | cut -f2 -d '|'` for x in $old_repo do - result=`zypper rr $x` + if ( ( pmatch "$x" "xCAT-$OSVER-path*" ) || ( pmatch "$x" "$OSVER-path*" ) ); then + result=`zypper rr "$x"` + fi done result=`zypper --non-interactive refresh 2>&1` @@ -491,7 +493,8 @@ elif ( pmatch "$OSVER" "rhel*" && [ $hasyum -eq 1 ] ); then if [ -r "/etc/yum.repos.d/local-repository.repo" ]; then result=`rm /etc/yum.repos.d/local-repository.repo 2>&1` fi - result=`rm /etc/yum.repos.d/xCAT*.repo 2>&1` + rm /etc/yum.repos.d/$OSVER-path*.repo >/dev/null 2>&1 + result=`rm /etc/yum.repos.d/xCAT-$OSVER-path*.repo 2>&1` result=`yum clean all`