Need clarity on when to use CURL, RPM, and YUM

Hello KodeKloud,

New guy here…so I appreciate your input.

As I was going through this DevOps pre-req course, I “thought” I had a clear understanding of what each of these commands were used for:

  • CURL - can be used to download a file via http/https (WGET is an alternative)
  • RPM - can be used to install a package. However, without dependencies
  • YUM - can be used to install a package + its dependencies

However, as I was going through the Labs - MySQL, there was an exercise asking me to install MySQL onto app01.

So I ssh’d into app01 and my first instinct is to download the .rpm file using the CURL command:

[email protected] ~]$ curl -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-server- 8.0.22-1.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

However, as you can see, the file did not download via the CURL command.

So I checked the hint…and it says that I need to use this command instead:

sudo yum install https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

This is where I get confused and need clarity. Why didn’t my CURL command work? Shouldn’t I need to download the .rpm file onto the server first (via CURL) prior to installing the package via YUM? I did not realize that I can run the YUM INSTALL command directly on an .rpm file via http/https.

An additional related question that I need some clarity on:
The hint says that after running this command:

sudo yum install https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

…I then need to run this command:

sudo yum install mysql-community-server

My question is… I already ran YUM INSTALL via the first command. So I assume it already installed the package + its dependencies. So why do I need to run the second command?

Thanks for your help.

This is where I get confused and need clarity. Why didn’t my CURL command work? Shouldn’t I need to download the .rpm file onto the server first (via CURL) prior to installing the package via YUM? I did not realize that I can run the YUM INSTALL command directly on an .rpm file via http/https.

sudo yum install https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

In the above command, you’re installing an .rpm with the repository information/setup. You can cross check by ls -l /etc/yum.repos.d/.
After that you can install via sudo yum install mysql-community-server.
As you already mention that
RPM - can be used to install a package. However, without dependencies
We can install direct packages (which is available in the system) through RPM. e.g.

$ rpm -ivh jq-1.6-2.el7.x86_64.rpm

I am in doubt. Because download link is not looks correct.