Saturday 29 October 2011

How to Create YUM repository in Redhat


Creation of YUM repository

By default createrepo-0.4.11-3.el5.noarch.rpm is not installed

1)
Need to install following packages

createrepo-0.4.11-3.el5.noarch.rpm
vsftpd-2.0.5-16.el5.x86_64.rpm


 # rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
# rpm -ivh vsftpd-2.0.5-16.el5.x86_64.rpm

 2)
### copy the 'Server' folder which contain rpms including their dependencies   in following path /var/ftp/pub

 # cp -rf Server /var/ftp/pub/

 3)

#### Bind the rpms with comps ----.xml with create repo command ###

# createrepo -g /media/RHEL_5.4\ x86_64\ DVD/Server/repodata/comps-rhel5-server-core.xml /var/ftp/pub/Server/

Configuration of repository  in the following path /etc/yum.repos.d/ rhel-5-6.repo  save and exit

#cd /etc/yum.repos.d
#touch rhel-5-6.repo
#vi  rhel-5-6.repo

[rhel-Server-5-6]
name=Red Hat Enterprise 5-6
baseurl=ftp://Give your system ip address/pub/rhel-5-6/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


[rhel-VT-5-6]
name=Red Hat Enterprise 5-6
baseurl=ftp://Give your system ip address/pub/rhel-5-6/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


Start FTP server and enable the FTP service in runlevels 

# /etc/init.d/vsftpd start
#chkconfig vsftpd on


Upgrade the patches as follows

# yum clean all
# yum list all

No comments:

Post a Comment