How to Create local YUM repo?

Hi friends,
I am using RHEL5 . I have tried to create the local repo using createrepo rpm.But i have been facing a lot of errors and it is not working well. Can somebody tell me how to create the local repo?
Thank you in advance.
Regards,
Prakashkumar.S

Copy the RPM files to your server and run "createrepo" utility.

Example:

i can say what i do :slight_smile:

# cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/my.repo

edit and change your yum path location
for exa my repo file

# vi my.repo
[-----yucelgemici-x64-packages-----]
name=Red Hat Enterprise Linux x64 -x64 Systems - Debug
baseurl=file:///Server/x64
# baseurl=http://myhttpserverIP/x64 --> for http
# baseurl=ftp://myftpserverIP/myrpmfullpath --> for ftp
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

for example and i cp rpm files to my local disk in /Server/x64 dir
for this i use nfs with /etc/exports

# cat /etc/exports
/Server 192.168.255.128(rw,async,no_root_squash)

and create repo

# cd /Server/x64 
# createrepo .

let clear all cache and headers

# yum clean all

list our repos

# yum repolist
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
-----yucelgemici-i386-packages-----                                                                                  |  951 B     00:00
primary.xml.gz                                                                                                       | 1.3 kB     00:00
-----yucelgemici-i386-packages-----                            1/1
-----yucelgemici-x64-packages-----                                                                                   |  951 B     00:00
primary.xml.gz                                                                                                       | 108 kB     00:00
-----yucelgemici-x64-packages-----                             408/408
repo id              repo name                                status
-----yucelgemici-i38 Red Hat Enterprise Linux i386 -i386 Syst enabled :       1
-----yucelgemici-x64 Red Hat Enterprise Linux x64 -x64 System enabled :     408
repolist: 409

Thats all :wink:

1 Like