Home>Article>Operation and Maintenance> centos7 replaces domestic yum source

centos7 replaces domestic yum source

王林
王林 forward
2020-08-03 17:11:20 9624browse

centos7 replaces domestic yum source

Specific steps:

(Recommended tutorial:centos tutorial)

1. Backup

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

Or

mv /etc/yum/repos.d/CentOS-Base.repo{,.date -I}

2. Download the new CentOS-Base.repo to /etc/yum.repos.d/

CentOS 5

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

or

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

CentOS 6

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

or

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

CentOS 7

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

or

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

(video tutorial Recommended:linux video tutorial)

3. Add EPEL

CentOS 6

wget -O /etc/yum.repos.d/epel-6.repo http://mirrors.aliyun.com/repo/epel-6.repo

CentOS 7

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

4. Clean cache And generate a new cache

yum clean all yum makecache

Done!

The above is the detailed content of centos7 replaces domestic yum source. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linux公社. If there is any infringement, please contact admin@php.cn delete