In this lab, you manage software repositories, and install and upgrade packages from those repositories.
Outcomes
Manage software repositories.
Install and upgrade packages from repositories.
Install an RPM package.
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-review
Instructions
On the serverb machine, configure a software repository to obtain updates.
Name the repository errata and configure the repository in the /etc/yum.repos.d/errata.repo file.
Configure the errata.repo file to use the http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata repository.
Do not verify GPG signatures.
Log in to the serverb machine as the student user, and switch to the root user.
[student@workstation ~]$ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#
Create the /etc/yum.repos.d/errata.repo file with the following content:
[errata] name=Red Hat Updates baseurl=http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata enabled=1 gpgcheck=0
On serverb, install the rht-system package.
List the available packages for the rht-system package.
[root@serverb ~]#dnf list rht-systemLast metadata expiration check: 0:05:27 ago on Wed 27 Apr 2022 05:01:59 AM EDT.Available Packagesrht-system.noarch1.0.0-2errata
Install the latest version of the rht-system package.
[root@serverb ~]#dnf install rht-system...output omitted... Total download size: 7.5 k Installed size: 300 Is this ok [y/N]:y...output omitted... Complete! [root@serverb ~]#
For security reasons, the serverb machine must not be able to connect to a paper printer.
You can achieve this effect by removing the cups package.
When finished, exit from the root shell.
List the installed cups package.
[root@serverb ~]#dnf list cupsLast metadata expiration check: 0:08:02 ago on Wed 27 Apr 2022 05:01:59 AM EDT. Installed Packagescups.x86_641:2.3.3op2-13.el9 @rhel-9.0-for-x86_64-appstream-rpms [root@serverb ~]#
Remove the cups package.
[root@serverb ~]#dnf remove cups.x86_64...output omitted... Remove 46 Packages Freed space: 94 M Is this ok [y/N]:y...output omitted... Complete!
Exit from the root shell.
[root@serverb ~]# exit
[student@serverb ~]$The start script downloads the rhcsa-script-1.0.0-1.noarch.rpm package in the /home/student directory on the serverb machine.
Confirm that the rhcsa-script-1.0.0-1.noarch.rpm package is available on serverb, and install it by using root privileges.
Verify that the package is installed.
Exit from the serverb machine.
Verify that the rhcsa-script-1.0.0-1.noarch.rpm package is available on serverb.
[student@serverb ~]$ rpm -q -p rhcsa-script-1.0.0-1.noarch.rpm -i
Name : rhcsa-script
Version : 1.0.0
Release : 1
Architecture: noarch
Install Date: (not installed)
Group : System
Size : 593
License : GPL
Signature : (none)
Source RPM : rhcsa-script-1.0.0-1.src.rpm
Build Date : Wed 23 Mar 2022 08:24:21 AM EDT
Build Host : localhost
Packager : Bernardo Gargallo
URL : http://example.com
Summary : RHCSA Practice Script
Description :
A RHCSA practice script.
The package changes the motd.Install the rhcsa-script-1.0.0-1.noarch.rpm package.
[student@serverb ~]$sudo dnf install \rhcsa-script-1.0.0-1.noarch.rpm[sudo] password for student:studentLast metadata expiration check: 0:11:06 ago on Wed 27 Apr 2022 05:01:59 AM EDT. Dependencies resolved. ========================================================================== Package Architecture Version Repository Size ========================================================================== Installing: rhcsa-script noarch 1.0.0-1 @commandline 7.5 k Transaction Summary ========================================================================== Install 1 Package Total size: 7.5 k Installed size: 593 Is this ok [y/N]:yDownloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: rhcsa-script-1.0.0-1.noarch 1/1 Installing : rhcsa-script-1.0.0-1.noarch 1/1 Running scriptlet: rhcsa-script-1.0.0-1.noarch 1/1 Verifying : rhcsa-script-1.0.0-1.noarch 1/1 Installed: rhcsa-script-1.0.0-1.noarch Complete!
Verify that the package is installed.
[student@serverb ~]$ rpm -q rhcsa-script
rhcsa-script-1.0.0-1.noarch
[student@serverb ~]$Return to the workstation system as the student user.
[student@serverb ~]$ exit
logout
Connection to serverb closed.
[student@workstation ~]$This concludes the section.