Translate

Archives

Configuring CentOS 7 For RHCSA7 Or RHCE7 Practice Labs

Suppose you wish to build a practice lab using CentOS while preparing for your RHSCA7 or RHCE7 exam. The first question you need to resolve is which version of CentOS to install.

RHEL7 was first released in 2014 and is currently at version 7.7. Here are the details of each release according to Wikipedia:

Red Hat Enterprise Linux 7 (Maipo) is based on Fedora 19, upstream Linux kernel 3.10, 
systemd 208 (updated to 219 in RHEL 7.2), and GNOME 3.8 (rebased to GNOME 3.28 in RHEL 7.6) 

The first beta was announced on 11 December 2013 and a release candidate was made
available on 15 April 2014.

On June 10, 2014 Red Hat Enterprise Linux 7 was officially released.

    Red Hat Enterprise Linux 7.0 (Maipo), June 10, 2014; uses Linux kernel 3.10.0-123
        7.1, also termed Update 1, March 5, 2015
            kernel 3.10.0-229
        7.2, also termed Update 2, November 19, 2015
            kernel 3.10.0-327
            systemd updated to 219
            GNOME rebased to 3.14
        7.3, also termed Update 3, November 3, 2016
            kernel kernel 3.10.0-514
        7.4, also termed Update 4, August 1, 2017
            kernel kernel 3.10.0-693
            GNOME rebased to 3.22
        7.5, also termed Update 5, April 10, 2018
            kernel 3.10.0-862
            GNOME rebased to 3.26[32]
        7.6, also termed Update 6, October 30, 2018
            kernel 3.10.0-957
            GNOME rebased to 3.28
        7.7, also termed Update 7, August 6, 2019
            kernel 3.10.0-1062
            GNOME remains as 3.28

Red Hat is mostly silent on which version of RHEL7 is used in the RHCSA7 and RHCE7 exams. A number of people have reported that Red Hat state that the version is 7.0, whilst others report encountering 7.1 and 7.2.

Suppose you decide to set up a practice lab based on CentOS 7.0. Where can you obtain an ISO image of CentOS 7.0? It is no longer downloadable from CentOS Vault (which strangely is not https-enabled.). Instead, you need to go to an alternative site such as as archive.kernal.org.

OK, you now have a CentOS 7.0 ISO and can install CentOS 7.0. However, you are not out of the woods yet! As soon as you do a yum update to update your CentOS 7.0 system, you will discover that your CentOS 7.0 system was updated to the latest version of CentOS 7 (currently 7.7). To avoid this happening, you need to modify the CentOS repository configuration files in /etc/yum.repos.d.

Here is the CentOS-Base.repo that comes with CentOS 7.0 (Build 1406):

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Save a copy of this file, i.e. CentOS-Base.repo Check all other CentOS-* repos, and disable if enabled. Then replace the existing content of Centos-Base.repo with the following:

#
# FPM CentOS-Base.repo for CentOS 7.0 (Build 1406)
#
# yum clean all
# yum --releasever=7.0 update
#

[base]
name=CentOS-$releasever - Base
baseurl=http://archive.kernel.org/centos-vault/7.0.1406/os/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://archive.kernel.org/centos-vault/7.0.1406/updates/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[extras]
name=CentOS-$releasever - Extras
baseurl=http://archive.kernel.org/centos-vault/7.0.1406/extras/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://archive.kernel.org/centos-vault/7.0.1406/centosplus/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0


After doing this, you can safely do a yum update to obtain updated packages for CentOS 7.0 and only CentOS 7.0. Don’t forget to clear the caches first!

# yum clean all
# yum --releasever=7.0 update

If you wish to conform to CentOS 7.1, replace your CentOS-Base.repo with the following contents:

#
# FPM CentOS-Base.repo for CentOS 7.1 (Build 1503)
#
# yum clean all
# yum --releasever=7.1 update
#
``
[base]
name=CentOS-$releasever - Base
baseurl=http://archive.kernel.org/centos-vault/7.1.1503/os/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://archive.kernel.org/centos-vault/7.1.1503/updates/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[extras]
name=CentOS-$releasever - Extras
baseurl=http://archive.kernel.org/centos-vault/7.1.1503/extras/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://archive.kernel.org/centos-vault/7.1.1503/centosplus/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0

If you wish to conform to CentOS 7.2, replace your CentOS-Base.repo with the following contents:

#
# FPM CentOS-Base.repo for CentOS 7.2 (Build 1511)
#
# yum clean all
# yum --releasever=7.2 update
#
``
[base]
name=CentOS-$releasever - Base
baseurl=http://archive.kernel.org/centos-vault/7.2.1511/os/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://archive.kernel.org/centos-vault/7.2.1511/updates/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[extras]
name=CentOS-$releasever - Extras
baseurl=http://archive.kernel.org/centos-vault/7.2.1511/extras/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://archive.kernel.org/centos-vault/7.2.1511/centosplus/x86_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0

Enjoy!

P.S Updated October 2019 to include CentOS 7.7

Comments are closed.