Linux Hands-On Lab - Installing and Managing Packages on RHEL/CentOS Systems

Linux Hands-On Lab - Installing and Managing Packages on RHEL/CentOS Systems

Linux Learning Path for Cloud and DevOps Engineers

📝Introduction

This post explains how we can Install and Managing Packages on RHEL/CentOS Systems.

The installation and removal of packages is a core skill for anyone managing Linux distributions. During this activity, we will work with the package manager utility yum and installation utility rpm to manage packages on Red Hat/CentOS Linux distributions.

You've been provisioned with a CentOS 7 server to use the yum and rpm commands.

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

  1. View the contents of the current directory:

     ls -la
    

    You should see a Downloads directory listed.

  2. View information about the Downloads directory:

     Downloads/
    
  3. Go into the Downloads directory:

     cd Downloads/
    
  4. View the contents of the current directory:

     ls -la
    

    You should see elinks listed.

  5. Install the elinks RPM package:

     sudo rpm -i elinks-0.12-0.37.pre6.el7.0.1.x86_64.rpm
    

  6. The installation will fail because of missing dependencies.

  7. View the first dependency that failed and see what provides the dependency:

     yum provides libmozjs185*
    

    You should get a result showing that it is provided by the js package (JavaScript).

  8. Install the js package:

     sudo yum install js -y
    

  9. Attempt to install the elinks RPM package again:

     sudo rpm -i elinks-0.12-0.37.pre6.el7.0.1.x86_64.rpm
    

    This attempt should fail again because installing the js package did not resolve all the missing dependencies.

  10. View the second dependency that failed and see what provides the dependency:

    yum provides */libnss_compat_ossl*
    

    You should see that it is provided by nss_compat_ossl.

  11. Install nss_compat_ossl:

    sudo yum install nss_compat_ossl -y
    

  12. Install the elinks RPM package again (3rd attempt):

    sudo rpm -i elinks-0.12-0.37.pre6.el7.0.1.x86_64.rpm
    

  1. Run elinks to verify that it works:

     elinks
    

  2. Attempt to open a website by providing a URL, such as https://www.google.com If the dependency issues have been resolved and the application is working properly, then you should be able to pull up that website successfully.

📌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 Install and Managing Packages on RHEL/CentOS Systems using yum and rpm commands.

Thank you for reading. I hope you understood and learned something helpful from my blog.

Please follow me on CloudDevOpsToLearn and LinkedIn, franciscojblsouza