Create a Local Yum Repository in CentOS 6.3 in 5 steps


Create a Local Yum Repository in CentOS 6.3 in 5 steps

1) Install CentOS 6.3 -> How to install CentOS 6.3 ; In CentOS6.3 Desktop Installation, Apache is installed in built. Verify

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers
Apache status in CentOS 6.3
Apache status in CentOS 6.3

2) Insert DVD/ISO into DVD-Drive. 3) Create Directory with mkdir -pv /var/www/html/centos/6.3/i386/RPMS/ and copy all RPM files from the DVD (Part-I, Part-II)

ifconfig - verify the IP Address of the Machine
ifconfig – verify the IP Address of the Machine

cp /var/www/html/centos6.3/i386/createrepo* /tmp/repo/

cp /var/www/html/centos6.3/i386/deltarpm* /tmp/repo/cp /var/www/html/centos6.3/i386/python-deltarpm* /tmp/repo/cp /var/www/html/centos6.3/i386/libxml2-python* /tmp/repo/
RPMs needed to run create Repository command createrepo
RPMs needed to run create Repository command createrepo
Run the RPMs
RPMs needed to run create Repository command createrepo 1
RPMs needed to run create Repository command createrepo 1
[root@localhost admin]# rpm-ivh /tmp/repo/deltarpm-3.5-0.5.20090913git.el6.i686.rpm
[root@localhost admin]# rpm -ivh /tmp/repo/python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm[root@localhost admin]# rpm -ivh /tmp/repo/libxml2-python-2.7.6-4.el6_2.4.i686.rpm [root@localhost admin]# rpm -ivh /tmp/repo/createrepo-0.9.8-5.el6.noarch.rpm
createrepo - Create repomd (xml-rpm-metadata) repository
createrepo  is a program that creates a repomd (xml-based rpm metadata)
       repository from a set of rpms.
4) [root@localhost admin]# createrepo /var/www/html/centos6.3/i386/
createrepo command
createrepo command

[root@localhost admin]# createrepo /var/www/html/centos6.3/i386/2559/4776 – php-tidy-5.3.3-3.el6_2.8.i686.rpm

iso-8859-1 encoding on Ville Skytt� <ville.skytta@iki.fi> – 2.8.24776/4776 – diffutils-2.8.1-28.el6.i686.rpm
Saving Primary metadata Saving file lists metadata Saving other metadata [root@localhost admin]#

Use Rsync to create the updates-released repository (Not tried) 5) Change baseurl as per assigned IP address or use Localhost; Make sure that you change baseurl in all sections in the /etc/yum.repos.d/CentOS-Base.repo file (Hint: You need to make sure that baseurl is correct else it will give error for repodata/repomd.xml file; If createrepo command will run successfully then this directory along with files will be created where all RPMs are located or where you have created repository. ).

edit -etc-yum.repos.d-CentOS-Base.repo
edit -etc-yum.repos.d-CentOS-Base.repo

Done!!!

Advertisements

4 thoughts on “Create a Local Yum Repository in CentOS 6.3 in 5 steps”

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