Build Yum Repository from local Server in Linux CentOS 6.4 64 bit

Posted: March 16, 2013 in FX Pipeline, Linux

centos.gif

Hi Friends,
build your Own Yum Repository
you can free download .Rpm package from:-
http://centosmirror.go4hosting.in/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-bin-DVD2.iso

lets start the process

step 01:-

[root@xw8600 Rajiv]#  yum -y install createrepo

step 02:-
[root@xw8600 Rajiv]# gedit /etc/yum.repos.d/hqvfx.repo

and copy similar entry (just change names and path according to your server)
In my case i have already map server drive in media.

# this is a Yum Repository file
[HQVFX-PIPELINE]
name= HQVFX Computing Lab Pipeline CentOS 6.4 RPM Repository
baseurl=file:///media/pipeline/repo/Centos6.4_x64
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

step 03
Create repodata/repomd.xm
other wise you will get this kind of error 
[Errno 14] Could not open/read file:///media /repodata/repomd.xml

[root@xw8600 Rajiv]# createrepo /media/pipeline/repo/Centos6.4_x64

Step 04
[root@xw8600 Rajiv]# yum clean all

[root@xw8600 Rajiv]# yum repolist

This will be the output in terminal:-

[root@xw8600 Rajiv]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
 * base: mirror.nbrc.ac.in
 * extras: mirror.nbrc.ac.in
 * rpmforge: fr2.rpmfind.net
 * updates: mirror.nbrc.ac.in
HQVFX-PIPELINE                                                                                                                          | 2.9 kB     00:00 ... 
HQVFX-PIPELINE/primary_db                                                                                                               | 1.1 MB     00:00 ... 
base                                                                                                                                    | 3.7 kB     00:00     
base/primary_db                                                                                                                         | 4.4 MB     00:04     
extras                                                                                                                                  | 3.5 kB     00:00     
extras/primary_db                                                                                                                       |  19 kB     00:00     
google-chrome                                                                                                                           |  951 B     00:00     
google-chrome/primary                                                                                                                   | 1.4 kB     00:00     
google-chrome                                                                                                                                              3/3
linuxtech-release                                                                                                                       | 1.3 kB     00:00     
linuxtech-release/primary                                                                                                               | 327 kB     00:01     
linuxtech-release                                                                                                                                    1037/1037
rpmforge                                                                                                                                | 1.9 kB     00:00     
rpmforge/primary_db                                                                                                                     | 2.5 MB     00:05     
updates                                                                                                                                 | 3.5 kB     00:00     
updates/primary_db                                                                                                                      | 1.2 MB     00:01     
repo id                                                   repo name                                                                                      status
HQVFX-PIPELINE                                            HQVFX Computing Lab Pipeline CentOS 6.4 RPM Repository                                         2,426
base                                                      CentOS-6 - Base                                                                                6,381
extras                                                    CentOS-6 - Extras                                                                                 12
google-chrome                                             google-chrome                                                                                      3
linuxtech-release                                         LinuxTECH.NET el6 production repo                                                              1,037
rpmforge                                                  RHEL 6 - RPMforge.net - dag                                                                    4,458
updates                                                   CentOS-6 - Updates                                                                               235
repolist: 14,552
[root@xw8600 Rajiv]# 


[root@xw8600 Rajiv]# yum list installed



You can see Our Repo is successfully listed in repolist and we have 2,426 rpm in our local server.

Cheers
Rajiv Sharma
Advertisements

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