Home > Redhat Administration, Uncategorized > Create local yum repository

Create local yum repository

1. Copy all packages into local directory /opt/yum/rhel6.3/repodata

# mkdir -p /opt/yum/rhel6.3/repodata

# mount /dev/sr0 /mnt ( redhat CDROM)

# cd /mnt/Packages

# cp -a * /opt/yum/rhel6.3/repodata

2. Copy the main xml from the CDROM repodata directory and rename it to comps.xml 

# cd /mnt/repodata

# cp *comps*.xml /opt/yum/rhel6.3/repodata/comps.xml

3. Install createrepo
# cd /mnt/Packages
# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64
# rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm
4. Create local repository files
# cd /opt/yum/rhel6.3
# createrepo -g repodata/comps.xml .
5. Create local yum repository
# cd /etc/yum.repos.d
# vi rhel-local.repo[rhel6.3-local]
name=RHEL 6.3 local repository
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: