Local yum repository CentOS 6.3

Creating A Local Yum Repository (CentOS)

1. Verify if ‘createrepo’ is already installed. If it is installed, skip step 2 and continue from step 3. Otherwise, proceed to the next step.

[root@rep-serv ~]# rpm -qi createrepo

2. If ‘createrepo’ isn’t already installed, since it isn’t by default; install it.

[root@rep-serv ~]# yum -y install createrepo

3.Create the Directories:

 mkdir -pv /updates/centos/6/{base,updates}/x86_64

<modify parameters for your machine>

4. Launch your favorite text editor again (mine is ‘vim’) to edit ‘/etc/yum.repos.d/CentOS-Base.repo’.

Save the old file: cp CentOS-Base-repo CentOS-Base.repo-original

[root@rep-serv ~]# vim /etc/yum.repos.d/CentOS-Base.repo

5. Copy the following, paste into ‘/etc/yum.repos.d/CentOS-Base.repo’ and save the file and exit :

[lbase]
name=CentOS-$releasever – Base
baseurl=file:///updates/centos/6/base/$basearch/
#baseurl=ftp://internalhost.com/yumrepo/centos/$releasever/$basearch
#baseurl=http://internalhost.com/localrepo/centos/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[updates]
name=CentOS-$releasever – Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=file:///updates/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

 

Synchronize to a mirror of your choice:

[root@rep-serv ~]# rsync -avrt rsync://mirrors.usc.edu/centos/6/updates/i386 –exclude=debug/ /updates/centos/6/updates/
6. Copy Packages from DVD to local drive (CentOS6.4 x86_64)

create local base repo with group information:

createrepo -g /media/CentOS_6.4_Final/repodata/2727fcb43fbe4c1a3588992af8c19e4d97167aee2f6088959221fc285cab6f72-c6-x86_64-comps.xml /updates/centos/6/base/

7.if you install new updates

createrepo /updates/centos/6/updates/x86_64/

yum clean all && yum makecache

Quelle:

http://tuxers.com/main/settingup-a-local-private-yum-repository-lpyr-on-centos-part1/

http://www.howtoforge.com/creating_a_local_yum_repository_centos

http://rhel6notes.blogspot.de/2011/02/yum-error-no-group-data-available-for.html