[1] First backup CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[2] Enter the yum source configuration file directory
cd /etc/yum.repos.d/
[3] Download Alibaba Cloud's yum source configuration file
- Put in /etc/yum.repos.d/ (please make corresponding backup before operation)
163:
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
centos5 :
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
centos6:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
centos7:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[4] Cleanup
yum clean all
[5] Update cache
yum makecache
yum install tree -y
yum update -y
yum -y update