RHCSA Rapid Track
Configure your server to get packages from a remote DNF repository, and then update or install a package from that repository.
Outcomes
Configure a system to obtain software updates from a classroom server, and update the system to use the latest packages.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start software-repo
Instructions
Use the
sshcommand to log in to theserverasystem as thestudentuser. Use thesudo -icommand to switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Configure the software repositories on
serverato obtain custom packages and updates from the following URL:Custom packages at
http://content.example.com/rhel9.3/x86_64/rhcsa-practice/rhtUpdates of the custom packages at
http://content.example.com/rhel9.3/x86_64/rhcsa-practice/errata
Use the
dnf config-managercommand to add the custom packages repository.[root@servera ~]#
dnf config-manager \--add-repo "http://content.example.com/rhel9.3/x86_64/rhcsa-practice/rht"Adding repo from: http://content.example.com/rhel9.3/x86_64/rhcsa-practice/rhtExamine the software repository file that the previous command created in the
/etc/yum.repos.ddirectory. Edit the/etc/yum.repos.d/content.example.com_rhel9.3_x86_64_rhcsa-practice_rht.repofile, and add thegpgcheck=0parameter to disable the GPG key check for the repository.[content.example.com_rhel9.3_x86_64_rhcsa-practice_rht] name=created by dnf config-manager from http://content.example.com/rhel9.3/x86_64/rhcsa-practice/rht baseurl=http://content.example.com/rhel9.3/x86_64/rhcsa-practice/rht enabled=1
gpgcheck=0Create the
/etc/yum.repos.d/errata.repofile to enable the updates repository with the following content:[rht-updates] name=rht updates baseurl=http://content.example.com/rhel9.3/x86_64/rhcsa-practice/errata enabled=1 gpgcheck=0
Use the
dnf repolist allcommand to list all repositories on the system.[root@servera ~]#
dnf repolist allrepo id repo name statuscontent.example.com_rhel9.3_x86_64_rhcsa-practice_rhtcreated by .... enabled ...output omitted...rht-updatesrht updates enabled
Disable the
rht-updatessoftware repository and install therht-systempackage.Use the
dnf config-manager --disablecommand to disable therht-updatesrepository.[root@servera ~]#
dnf config-manager --disable rht-updatesList, and then install, the
rht-systempackage.[root@servera ~]#
dnf list rht-systemAvailable Packages rht-system.noarch 1.0.0-1 content.example.com_rhel9.3_x86_64_rhcsa-practice_rht [root@servera ~]#dnf install rht-systemDependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: rht-system noarch 1.0.0-1 content..._rht 3.7 k ...output omitted... Is this ok [y/N]:y...output omitted... Installed: rht-system-1.0.0-1.noarch Complete!Verify that the
rht-systempackage is installed, and note the version number of the package.[root@servera ~]#
dnf list rht-systemInstalled Packagesrht-system.noarch1.0.0-1@content.example.com_rhel9.3_x86_64_rhcsa-practice_rht
Enable the
rht-updatessoftware repository and update all relevant software packages.Use
dnf config-manager --enableto enable therht-updatesrepository.[root@servera ~]#
dnf config-manager --enable rht-updatesUse the
dnf updatecommand to update all software packages onservera.[root@servera ~]#
dnf updateDependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Upgrading: rht-system noarch 1.0.0-2 rht-updates 7.5 k ...output omitted... Is this ok [y/N]:y...output omitted... Complete!Verify that the
rht-systempackage is upgraded, and note the version number of the package.[root@servera ~]#
dnf list rht-systemInstalled Packagesrht-system.noarch1.0.0-2@rht-updates
Exit from
servera.[root@servera ~]#
exitlogout [student@servera ~]$exitlogout Connection to servera closed. [student@workstation ~]$