The following column of Centos usage tutorial will introduce to you how to replace the original yum source of Centos with Alibaba source. I hope it will be helpful to you. Friends in need help!
A brief introduction to several open source sites
If you need to download some image files, For example, open source software such as CentOS or Ubuntu can be obtained through the following mirror sites in China.
Alibaba’s open source mirror station (https://opsx.alibaba.com/)
NetEase open source mirror station (http://mirrors.163.com/)
Tsinghua University Open Source Mirror Station (https://mirrors.tuna.tsinghua.edu.cn/)
Get to the point
1.Backup
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. Download the new CentOS-Base.repo to /etc/yum.repos.d/
CentOS 5 [root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo CentOS 6 [root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo CentOS 7 [root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3. Run yum makecache to generate cache
[root@localhost ~]# yum clean all [root@localhost ~]# yum makecache [root@localhost ~]# yum update
Here is the explanation of yum makecache: That is to download the server's package information to the local computer and cache it.
The above is the detailed content of How to replace the original Centos yum source with Alibaba source. For more information, please follow other related articles on the PHP Chinese website!