Linux Hands-On Lab - Troubleshooting RPM Issues

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

  1. Install the telnet package:

      yum install telnet -y
    

    It must fail.

  2. Verify the integrity of the RPM database:

     cd /var/lib/rpm/
    
     /usr/lib/rpm/rpmdb_verify Packages
    

    You must see some failed entries.

  3. Rebuild the RPM database:

      rpm -vv --rebuilddb
    
  4. Verify the integrity of the new RPM database:

      /usr/lib/rpm/rpmdb_verify Packages
    

  5. Query installed packages for errors:

      rpm -qa > /dev/null
    
  6. 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

  1. Attempt to install Apache:

      yum install httpd -y
    

    It must fail.

  2. Edit /etc/yum.conf and comment on the line #exclude=httpd:

      vim /etc/yum.conf
      #exclude=httpd
    
  3. Save and close the file

  4. Try to Install Apache again:

      yum install httpd -y
    

  5. 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