From 9f98c732ec68fb779bb2205d9f9970a4db4670aa Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 5 Jul 2024 20:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3centos7=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E6=BA=90=E4=B8=8B=E6=9E=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 434bf501..6de43e0f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -41,7 +41,32 @@ jobs: run: | docker pull centos:7 docker run -v $(pwd):/root -w /root --rm centos:7 sh -c " + #!/bin/bash set -x + + # Backup original CentOS-Base.repo file + cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup + + # Define new repository configuration + cat < /etc/yum.repos.d/CentOS-Base.repo + [base] + name=CentOS-7 - Base - mirrors.aliyun.com + baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/ + gpgcheck=1 + gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 + + [updates] + name=CentOS-7 - Updates - mirrors.aliyun.com + baseurl=http://mirrors.aliyun.com/centos/7/updates/x86_64/ + gpgcheck=1 + gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 + EOF + + # Clean yum cache and recreate it + yum clean all + yum makecache + + echo \"CentOS 7 软件源已成功切换\" yum install -y git wget gcc gcc-c++ make mkdir -p /root/install