Focus on cloud service provider activities
Notes on website operation and maintenance

The method for CentOS7 system to replace AliCloud image source and update the latest source

Today, Lao Zuo got a Linux server and chose the CentOS7 system in the background of the host company, because a student needs to install the pagoda panel to build a website, and if you install the pagoda panel, it would be better to have CENTOS7+system compatibility. However, during the installation, I found that the system's available energy is relatively old. Here I am going to replace it with an AliCloud image source.

First, backup system image files

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

Back up the original yum source. We can restore it in case of errors after backup.

Second, download Alibaba Cloud CENTOS7 image file

yum install wget -y

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

 Download Alibaba Cloud CENTOS7 image file

Third, clear the cache and regenerate the cache

yum clean all
yum makecache

 The method for CentOS7 system to replace AliCloud image source and update the latest source

Fourth, update the latest source settings

yum update -y

Here we update the latest centos7 source. I didn't make a mistake here. If there is a mistake, we will find a solution.

 The method for CentOS7 system to replace AliCloud image source and update the latest source

To sum up, if it is necessary to use and replace the CENTOS7 system source, I will generally use the domestic image source to upgrade the latest one if I cannot update directly after getting the server. This is also to prevent system security. Lao Zuo recorded that CENTOS5 and CENTOS7 are also AliCloud images, which can be set the same way if necessary.

# CentOS 5
wget -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

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » The method for CentOS7 system to replace AliCloud image source and update the latest source


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge