Linux server configuration to access the yum source of the external network

1 Enter the directory /etc/yum.repos.d/

insert image description here

2 Backup the original image file

mv CentOS-Base.repo CentOS-Base.repo.bak

insert image description here

3 Download the new CentOS-Base.repo

Execute any of the following commands:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

insert image description here

4 Clear the original yum cache

yum clean all

insert image description here

5 Generate cache

yum makecache

insert image description here

Guess you like

Origin blog.csdn.net/Keyuchen_01/article/details/122026808
Recommended