Sunday, June 16, 2013

               
   
   
   

How to configure yum in RHEL6

Q. How do I install RPM packages along with dependence ?

RPM package management does not auto-resolve dependencies so better use YUM (Yellowdog Updater Modified ) package management method It’s resolve auto dependency and ability to specify multiple package source

For example let's see how to configure the YUM local repository from Linux ISO image for  RHEL6 

Here is step by step configuration for yum local repository setup?

1.You need root privileges to setup the yum
#su
2. First create the mount point and mount the ISO image as follows
#mkdir -p /mnt/iso/rhel6/
# mount -o loop rhel-server-6.1-i386-dvd.iso /mnt/iso/rhel6/
3. Copy all *rpm from mounted ISO image to the local directory /path/to/RPMS
#cp -v  /mnt/iso/rhel6/Packges/ *.rpm /path/to/RPMS/
4. You need a createrepo package to create the repository so check createrepo RPM is installed
#rpm -aq | grep createrepo
5. If createrepo package is not installed then you need to install
#rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
6. Change directory to /path/to/RPMS/  & Createrepo queries all packages and generate the SQLlite Database under repodata directory
#cd /path/to/RPMs/
#createrepo .
7. Now Verify generated file in /path/to/RPMS
# cd /home/RHEL/RPM/repodata/
# ls
filelists.xml.gz  other.xml.gz  primary.xml.gz  repomd.xml
8.Now You need to get the Redhat RPM GPG Key from CD/ISO & copy it to /path/to/RPMS
#cp -v /mnt/iso/rhel6/RPM-GPG-KEY* /path/to/RPM
9.To Configure yum repository go to /etc/yum/repos.d/ where we configure individual local repo
# cd /etc/yum.repos.d/
Add as per below config & put your local RPMS path in file:///
# vi local.repo
[local.repo]
name=local.repo
baseurl=file:///path/to/RPMS  
enabled=1
gpgcheck=1   
 Note : file:/// use to access local system files
         enable=1 It means turn on the repository
          If you don't want to use RPM-GPG-KEY* then turn off gpgcheck=0

10. Before install package you need to clean yum cache directory
#yum clean all
11.Now Install the package by yum
#yum install vsftpd
Here are some useful yum commands examples :

1.Assumes yes and removes both packages
#yum -y erase vsftpd lftp
2.To Search for package
#yum search lftp
3.To check the package metadata
#yum info lftp
4.Install the package
#yum install lftp
5.To check dependencies and package providers 
#yum deplist lftp
6.ReInstall the package
#yum reinstall lftp
7.Assumes yes when prompted
#yum -y reinstall lftp
8.Returns usage history. same like BASH Shell history
#yum history
Enjoy the yum package management !

If you like this please share it

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

 
Follow my blog with Bloglovin UA-41829888-1