Linux Hands-On Lab - Troubleshooting RPM Issues
Linux Learning Path for Cloud and DevOps Engineers
📝Introduction
This post explains how we can troubleshoot some RPM issues.
During this activity, we will work with some commands for troubleshooting RPM issues when running some packages (Telnet and Apache).
I've been provisioned with a RHEL 7.9 Enterprise server.
📝Log in to the AWS Management Console
Using your credentials, make sure you're using the right Region. In my case, I am using AWS as my cloud provider and chose us-east-1
. However, you are free to choose any cloud provider and create your 2 Linux Server VMs (I am using a CentOS 7 distro) for this hands-on lab.
One of the servers will be our main server and the other our client-server.
📌Note: You must create the AWS Access Key and AWS Secret Access Key and configure the AWS CLI in the terminal to use it.
You can use link1 and link2 for it.
📝Install Telnet
Install the
telnet
package:yum install telnet -y
It must fail.
Verify the integrity of the RPM database:
cd /var/lib/rpm/
/usr/lib/rpm/rpmdb_verify Packages
You must see some failed entries.
Rebuild the RPM database:
rpm -vv --rebuilddb
Verify the integrity of the new RPM database:
/usr/lib/rpm/rpmdb_verify Packages
Query installed packages for errors:
rpm -qa > /dev/null
Install
telnet
:yum install telnet -y
If you get this error below, you must run the command below the screenshot as a WA to fix this issue:
echo 7Server > /etc/yum/vars/releasever
Now, you can try to run again the command to install the Telnet.
📝Update Apache
Attempt to install Apache:
yum install httpd -y
It must fail.
Edit
/etc/yum.conf
and comment on the line#exclude=httpd
:vim /etc/yum.conf #exclude=httpd
Save and close the file
Try to Install Apache again:
yum install httpd -y
If you want to check if Apache was installed correctly, you can enable and start their services, and then run the
curl
command to load and see the HTML page.systemctl enable httpd.service systemctl start httpd.service systemctl status httpd.service curl http://localhost
📌Note - At the end of each hands-on Lab, always clean up all the resources previously created to avoid being charged if you used a Cloud Provider to provision them.
Congratulations — you have completed this hands-on lab covering the basics of troubleshooting some RPM issues.
Thank you for reading. I hope you understood and learned something helpful from my blog.
Please follow me on CloudDevOpsToLearn and LinkedIn, franciscojblsouza