This article is a mirror article of machine translation, please click here to jump to the original article.

View: 26419|Reply: 5

[linux] Replace Centos' yum source with domestic Alibaba Cloud source

[Copy link]
Posted on 3/26/2018 9:53:07 AM | | |
1. Backup
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

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

3. Then run yum makecache to generate a cache





Previous:CentOS ActiveMQ is added to the service
Next:Tutorial on installing Java virtual machines under CentOS
 Landlord| Posted on 3/26/2018 9:53:38 AM |
Alibaba Cloud Mirror Station: https://opsx.alibaba.com/mirror?lang=zh-cn
NetEase Mirror Station: http://mirrors.163.com/.help/centos.html
 Landlord| Posted on 3/26/2018 10:04:47 AM |
CentOS 5 has ended support on 2017-03-31 and no longer provides maintenance updates, so the files including Alibaba Cloud Mirror may be outdated or some files are missing.

The CentOS 5 version will receive the following error:

[root@xxxx yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* addons: mirrors.aliyun.com
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
http://mirrors.aliyun.com/centos/5/addons/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.aliyuncs.com/centos/5/addons/x86_64/repodata/repomd.xml: [Errno 12] Timeout: <urlopen error timed out>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again



 Landlord| Posted on 3/30/2018 9:20:57 AM |
LSB Version:        :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32: printing-4.0-noarch
Distributor ID:        CentOS
Descrip{filter}tion: CentOS release 5.11 (Final)
Release:        5.11
Codename:        Final

CentOS-Base.repo file:



CentOS-Base.repo (426 Bytes, Number of downloads: 0, 售价: 1 粒MB)

 Landlord| Posted on 7/28/2021 4:08:22 PM |
 Landlord| Posted on 8/26/2023 4:04:35 PM |
CentOS 8 replacement source

CentOS 8 (non-Stream version) has entered the EOL end-of-service phase ahead of schedule, so the mirror has been officially moved. If you are looking for images of these systems, please refer to centos-vault for help.

CentOS Vault Repository Image Usage Help:https://mirrors.tuna.tsinghua.edu.cn/help/centos-vault/
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com