$ sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.4.2105.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.4.2105.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.4.2105.repo
手动输入
1 2
$ vi /etc/yum.repos.d/Centos-vault-8.4.2105.repo $ vi /etc/yum.repos.d/epel-archive-8.repo
# CentOS-8.4.2105.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-8.4.2105 - Base - mirrors.cloud.aliyuncs.com baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/8.4.2105/BaseOS/$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.4.2105/BaseOS/$basearch/os/ http://mirrors.aliyun.com/centos-vault/8.4.2105/BaseOS/$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful [extras] name=CentOS-8.4.2105 - Extras - mirrors.cloud.aliyuncs.com baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/8.4.2105/extras/$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.4.2105/extras/$basearch/os/ http://mirrors.aliyun.com/centos-vault/8.4.2105/extras/$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that extend functionality of existing packages [centosplus] name=CentOS-8.4.2105 - Plus - mirrors.cloud.aliyuncs.com baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/8.4.2105/centosplus/$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.4.2105/centosplus/$basearch/os/ http://mirrors.aliyun.com/centos-vault/8.4.2105/centosplus/$basearch/os/ gpgcheck=0 enabled=0 gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-Official