#!/bin/bash

yum clean all

cp -a /etc/yum.repos.d/CentOS-Base.repo{,.bk}
tee /etc/yum.repos.d/CentOS-Base.repo <<END
[base]
name=CentOS-7 - Base
baseurl=https://vault.centos.org/7.9.2009/os/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-7 - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-7 - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
END

yum update -y
yum install vim bash-completion -y
