Chapter 14: Install and Update Software Packages
Hello there!
Today, I tackled the lab exercises for chapter 14 of my RH124 course, which covered installing and updating software packages in a Red Hat system. In this chapter, I explored how software is packaged and provided through RPM packages and delved into the functionalities of the DNF and RPM commands in managing installed system packages. I also learned how to register a system to my Red Hat account and assign entitlements for software updates and support services using the Red Hat Subscription Management tool.
Throughout the lab, I practised finding, installing, and updating software packages using the dnf
command and gained an understanding of how to enable and disable the use of Red Hat or third-party repositories. Overall, this lab provided me with valuable hands-on experience in managing software packages in a Red Hat system and deepened my understanding of how to ensure that my system stays up-to-date with the latest software releases and security updates.
Question 1: 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 check GPG signatures.
Solution:
To begin, I switched to the serverb machine from my workstation using the ssh
command followed by the username and IP address. Once logged in, I switched to the root user account using the sudo -i
command.
Next, I created and opened the /etc/yum.repos.d/errata.repo
file using the vim
text editor. Within the file, I added the following text to configure the repository:
This sets the name of the repository to "Red Hat Updates", specifies the base URL for the repository, enables the repository, and disables GPG signature checking. Once I saved and closed the file, the repository was configured and ready to use.
Question 2: On serverb
, install the rht-system
package.
Solution:
To install the rht-system
package on serverb, I used the dnf
command. First, I checked if the package was available in the repository by running dnf list rht-system
. Then, to install the package, I used the command dnf install rht-system
. This command retrieved the package from the enabled repository and installed it on the system.
Question 3: 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.
Solution:
To remove the cups
package from the serverb machine, I first used the dnf list cups
command to verify the version of the package installed on the system. Then, to remove the package, I used the dnf remove cups.x86_64
command. This command uninstalled the package from the system.
Finally, I exited from the root shell by typing the exit
command. This ensured that I was no longer logged in as the root user and had reverted to my original user account.
Question 4: 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 using root
privileges. Verify that the package is installed. Exit from the serverb
machine.
Solution:
To confirm the availability and install the rhcsa-script-1.0.0-1.noarch.rpm
package on the serverb machine, I followed the following steps:
First, I confirmed the availability of the package by using the command rpm -q -p rhcsa-script-1.0.0-1.noarch.rpm -i
. This command checks if the package is present and provides information about it, such as its version and architecture.
Next, with root privileges, I used the command sudo dnf install rhcsa-script-1.0.0-1.noarch.rpm
to install the script. The sudo
command grants me the necessary privileges, and dnf
is the package manager used for installation. The package name and its full path were specified to ensure the correct package was installed.
To verify the successful installation of the package, I used the command rpm -q rhcsa-script
. This command confirms if the rhcsa-script
package is installed on the system.
Finally, I exited the serverb
machine, ensuring I returned to the workstation
machine.
Conclusion
This end-of-chapter lab on installing and updating software packages in a Red Hat system has provided me with valuable insights and practical experience. Throughout the chapter, I learned how to register a system to my Red Hat account, assign entitlements for software updates and support services, and explored the mechanisms by which software is provided as RPM packages.
By utilizing the powerful dnf
command, I successfully found, installed, and updated software packages, ensuring that my system remained up-to-date with the latest releases and security patches. I also gained knowledge on enabling and disabling server usage of Red Hat or third-party DNF repositories, offering flexibility in managing software sources.
Furthermore, I have learned how to configure a software repository to obtain updates and how to verify the availability of a package before installation. The process of installing the rhcsa-script-1.0.0-1.noarch.rpm
package was also demonstrated.
I would encourage readers to try out the lab exercises and gain practical experience with the concepts discussed. Also, feel free to share your thoughts and experiences in the comments section below. I would be delighted to engage with you and hear your feedback.