You are on page 1of 4

YUM

YUM: Yellowdog Update Modified.

We required installing packages, we do it with rpm command but if the rpm package
has lots of dependencies it becomes difficult to install if rpm’s are placed in
more than one location.

So the solution for this is YUM.

Development of RPM cemented the future of linux by greatly simplifying installation


of software. As the operating system become more complex, RPM began to show a few
weaknesses, primarily its inability to resolve dependencies.

To solve the problem of dependency resolution and package location, volunteer


programmers at Duke University developed Yellowdog Update Modified or YUM for
short. The system is based on repositories that hold rpm’s and a repodata file
list.

The YUM application can call upon several repositories for dependency resolution,
fetch the rpm’s and install the headed packages.

Qs: Now How to create YUM.

Ans: To create Yum we required to copy all (cd’s/dvd) in one location.

Now what can be that location?

BY yum even your network clients can install packages from the yum server via
ftp ,http services.

Now we will show them to configure the yum server and to install the packages .

The very first is the location it is :

/var/ftp/pub:

Why?

When you start ftp service /var/ftp/pub directory is shared for anonymous (public)
login. So it’s becomes quite easier for clients to install the packages from this
location.

Requirement:

Your RHEL 5 system with installation media(CD/DVD).

FTP service installed on the server.

Createrepo package installed on the server.

Steps:

1: First make a partition of atleast 5.0 GB and make mount point at /var/ftp/pub.

# By fdisk make a partition, format it with mkfs.ext3 filesystem.

Then mount it on /var/ftp/pub, and make entry in /etc/fstab.


#Make a directory with the name :

#mkdir –p /var/ftp/pub and then mount this on the partition which you have made.

After mounting, copy all the (cd’s/dvd) in this location.

Now by default in RHEL 5 (cd/dvd) is automount .

First insert the (cd/dvd) in cdrom after cd/dvd) is inserted,

#cd /misc/cd ( as the (cd/dvd) is automounted so direct path)

#cp –av * /var/ftp/pub ( this will start copying the (cd/dvd) in the given
location).

Ok now after copying all the (cd/dvd).

First go to the location and install the “vsftpd “ and “createrepo” packages .

#cd /var/ftp/pub

Here you will find a directory named “Server”

#cd Server

#rpm –ivh vfstpd…………….rpm

#rpm –ivh creterepo……….rpm

By this two command install these two rpm’s.

Then now we have to create a repository file.

#vi /etc/yum.repos.d/server.repo

[base]

name=Server1 Repository

baseurl=ftp://192.168.0.254/pub/Server

enabled=1

gpgcheck=0

[VT]

name=Server1 Repository

baseurl=ftp://192.168.0.254/pub/VT

enabled=1

gpgcheck=0

make the above entries in the file and save the file.

Explantion of the file:


The first two lines are any thing that you can write but this is proper fomat,

The third line is important because it show the path of the repository from where u
will get the packages. And the Ip address is the server ip means the machine which
has the repository, forth line is enabled=1 means this file is there existing. And
the last line ie gpgcheck =0 means if it is 1 then you get the certificate numbers
from redhat if you are giving the installation number at the time of installation
so by default keep it 0 and if u do enabled=0 means the file is no more exist for
the other users on the network.

Now the same file should be made on the clients machine with same syntax.

After making these file now we will create repository :

To create repostitory the command is

#createrepo -v /var/ftp/pub/

After this step,


IMP:Access your (cd/dvd) by graphics or text ,if possible access by graphics,
on (cd/dvd) you will see a folder named "Server" and "VT",
open the folder "Server" , inside this folder there is another folder "repodata",
open that folder,
you will see a file called "comps-rhel5-server-core.xml" copy this file by
selecting and paste it on your "Desktop".
Similarly go to your "VT" folder on the (cd/dvd) here also you will see a folder
named "repodata"
open "repodata" folder and here also you will see a file called "comps-rhel5-
vt.xml" copy this file also and select it and paste it on your "Desktop".

After Doing this, go back to your command prompt, now type the following command on
the prompt:

#createrepo -g /root/Desktop/comps-rhel5-server-core.xml /var/ftp/pub/Server

By this command it will make a repository of your Server packages but for the first
time you will get an error of .olddata file so remove this file and again make the
repository.

#rm –rf /var/ftp/pub/Server/.olddata (remove this file and after removing run the
below command),

#createrepo -g /root/Desktop/comps-rhel5-server-core.xml /var/ftp/pub/Server

(and make the repository)

Similarly then type

#createrepo -g /root/Desktop/comps-rhel5-vt.xml /var/ftp/pub/VT

By this command it will make a repository of your VT packages but for the first
time you will get an error of .olddata file so remove this file and again make the
repository.

#rm –rf /var/ftp/pub/VT/.olddata (remove this file and after removing run the
below command,

#createrepo -g /root/Desktop/comps-rhel5-vt.xml /var/ftp/pub/Server


Now your repository is ready.

Start the vsftpd service .

#service vsftpd restart

Now to check with your YUM working fine check with the ftp service

So first try to login in your own machine via ftp:

#ftp 192.168.0.254

Login with anonymous login ,

After login you will see the pub directory but you cant go beyond pub because now
selinux will block from further access,so to allow access give the following
command.

#restorecon –R /var/ftp/pub.

#yum clean all (to check status of yum)then again do the ftp connection and check:

This will allow the further access after ftp connection close the ftp session.

Now to check to install rpm packages from yum.

#yum list perl*

This command will check for the rpm package is there or not in the repository, and
also checks the package is installed or not.

#yum info perl*

This command will give the information of the package

#yum install perl*

To install the rpm package of perl*.

#yum remove perl*

To remove the package

#yum install bind*

This will install bind packages with all dependencies.

Similarly you can install packages form different machines also with the above
commands only thing is that the file of

/etc/yum.repos.d/server.repo should be same as the server file on client machine .

This is the information about yum.

You might also like