How to replace the original Centos yum source with Alibaba source

藏色散人
Release: 2020-04-26 17:14:36
forward
2215 people have browsed it

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!

How to replace the original Centos yum source with Alibaba source

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
Copy after login

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
Copy after login

3. Run yum makecache to generate cache

  [root@localhost ~]# yum clean all
    [root@localhost ~]# yum makecache
    [root@localhost ~]# yum update
Copy after login

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template