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

How to view the CentOS image version and change the CentOS7 image to a domestic image

Sometimes we need specific support in a certain image environment when operating a certain software. For example, we need to install a certain DOCKER software in the CENTOS7 test environment today, because there are several test machines used in ordinary times on the old left hand, so we will randomly select one to check whether the current image is the CENTOS7 version. Here we will record how to detect the CENTOS version.

 How to view the CentOS image version and change the CentOS7 image to a domestic image

First, how to view the CentOS image version

When selecting methods, we only need one of them. According to our actual needs, we can detect our current system image version.

1、uname -a

We can see this through this command:

Linux VM_0_6_centos 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

In the past, when installing acceleration software, we needed to check whether it was supported by a certain version. This is a visible version, but not the one we need. We only see 7. x version.

2、cat /etc/redhat-release

CentOS Linux release 7.5.1804 (Core)

We can see clearly that this is the 7.5 version. Then we will use this to check the CENTOS version.

Second, if the domestic image source is replaced

If we use domestic ECS servers, they are basically domestic image sources. If we use foreign images, there must be a slight problem. Foreign sources are slow to open, and sometimes it is troublesome to install software, so Lao Zuo generally recommends replacing them directly with domestic AliCloud or 163 sources, I have also recorded a lot of such articles on the website, but how to replace CENTOS7?

1. Backup image

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

We need to back up the existing image first.

2. AliCloud image

wget -O /etc/yum.repos.d/CentOS-Base.repo

We download AliCloud images.

3. Add EPEL

wget -O /etc/yum.repos.d/epel.repo

4. Update

yum clean all
Yum makecache - y # Generate cache
yum update -y

Finally, we update the system and run the system again. If there is no error, it means there is no problem.

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( one )
Do not reprint without permission: Lao Zuo's Notes » How to view the CentOS image version and change the CentOS7 image to a domestic image

Scan the code to follow the official account

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