Red Hat Linux – Yum and RPM

Ok , let’s try to find out the difference between yum and rpm :

RPM stands for red hat package manager. This is both a command and a back-end for programs like yum. Basically , softwares are distributed by wrapping them in the rpms. RPM has got few important commands that can be used to install , update and remove the software distribution package.

To Install:
—————
rpm -ivh package.rpm

To update:
—————–
rpm -U package.rpm

To remove:
—————-
rpm -e package

Note: While removing you should not include .rpm after the package name.

YUM on the other hand stands for Yellow Dog Update Modifier. This is basically a program that contains a list of repositories containing the rpms and from where it can fetch the rpms and get the package installed on the system.
It’s like a file containing the links for verious dependencies , modules and sub modules for one particular package , hence it is best to install a software using yum , so that if there is any dependency file missing it will not stop , but will continue fetching the file.  Let’s take a small example. We are trying to install a package called Xen ( don worry about what is Xen right now , we will talk about Xen in our next article) , if we simply use the rpm command it will not work because the rpm command will look for dependencies and will not find dependencies. Now before we install Xen using the YUM command we need to do some homework.

Homework:
—————
We have to create a file that can contain information about the dependencies and save it under /etc/yum in our system. Lets give the file a name like a.repo. Using the VI editor ( If you do not know what is VI , just remember it is a notepad type editor used in Linux) , we edit the repo :

[Server]
name= hello
baseurl= ftp://172.24.1.254/dump/Server
gpgcheck= 0
enable= 1

[VT]

name=hi
baseurl= ftp://172.24.1.254/dump/VT
gpgcheck=0
enable=1

Save this file. Note that the most important line in this file is the baseurl line. The reason being you have to specify where does the required dependencies would be found. Put it simple , you are trying to mention that the files for the VT
library would be lying under ftp://172.24.1.254/dump/VT and so on for the Server library. Now whenever you save the file and run the yum command : yum install Xen

It will run just fine since whenever it will encounter the VT or the Server dependencies it will search the YUM directory
and list all the repo files . While doing this it will encounter a.repo and will scan it , it will then find the location from the baseurl line and instal the concerned dependenciy. Simple !!!!.

If you are still confused or could not understand the above please drop a reply . I will get back to you .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s