Project

General

Profile

Get centos repo

#!/bin/bash
cd /etc/yum.repos.d

crpm=centos-release-7-7.1908.0.el7.centos.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/$crpm
wget https://download.docker.com/linux/centos/docker-ce.repo

for F in `rpm2cpio $crpm | cpio -t | grep yum.repos.d 2>&1`; do
     echo F=$F;
     rpm2cpio  $crpm | cpio -idv $F;
done

/bin/cp etc/yum.repos.d/* /etc/yum.repos.d/

for F in `rpm2cpio $crpm | cpio -t | grep RPM-GPG-KEY 2>&1`; do
     echo F=$F;
     rpm2cpio  $crpm | cpio -idv $F;
done

/bin/cp etc/pki/rpm-gpg/* /etc/pki/rpm-gpg

rm -rf etc
rm -f $crpm
yum clean all
yum makecache fast
yum repolist