Difference between revisions of "Making local yum rpm repositorie"

From Teknologisk videncenter
Jump to: navigation, search
m (New page: Install ''createrepo'' <pre> yum install createrepo </pre> Make directory structure * A directory called ''base'' which holds local copy of RPM's * A directory called ''updates'' which ...)
 
m (Links)
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
</pre>
 
</pre>
  
 
+
= Preparing=
 
Make directory structure
 
Make directory structure
 
* A directory called ''base'' which holds local copy of RPM's
 
* A directory called ''base'' which holds local copy of RPM's
Line 10: Line 10:
 
On this server which is a PXE install server the RPM's are already resident on the ftp server ''/var/ftp/install/centos52/CentOS/RPMS'' which I just link to the repositorie
 
On this server which is a PXE install server the RPM's are already resident on the ftp server ''/var/ftp/install/centos52/CentOS/RPMS'' which I just link to the repositorie
 
<pre>
 
<pre>
mkdir -p/var/www/html/Centos/52/yum/updates
+
mkdir -p /var/www/html/Centos/52/yum/updates
 
ln -s /var/ftp/install/centos52/CentOS/RPMS /var/www/html/Centos/52/yum/base
 
ln -s /var/ftp/install/centos52/CentOS/RPMS /var/www/html/Centos/52/yum/base
 
</pre>
 
</pre>
 +
= Creating repository headers =
 
Now create the base repository headers: (Takes a couple of minuttes)<br/>
 
Now create the base repository headers: (Takes a couple of minuttes)<br/>
 
''createrepo'' creates some files in a new ''repodata'' directory.
 
''createrepo'' creates some files in a new ''repodata'' directory.
Line 20: Line 21:
 
filelists.xml.gz  other.xml.gz  primary.xml.gz  repomd.xml
 
filelists.xml.gz  other.xml.gz  primary.xml.gz  repomd.xml
 
</pre>
 
</pre>
 +
= Updating the repository =
 +
Now update the repositorie<br/>
 +
'''NOTE:''' rsync uses TCP port 873 which need to be open to the internet.
 +
Choose update sources from [http://www.centos.org/modules/tinycontent/index.php?id=31 CentOS European Mirrors]
 +
<pre>
 +
/usr/bin/rsync -avrt rsync://mirrors.se.kernel.org/centos/5.2/updates/i386 --exclude=debug/ /var/www/html/Centos/52/yum/updates
 +
</pre>
 +
=Links=
 +
*[http://www.howtoforge.com/creating_a_local_yum_repository_centos howtoforge] on local repository
 +
*[http://dotancohen.com/howto/yum_repo.html repository] on fedora
 +
[[category:Linux]][[Category:CentOS]]

Latest revision as of 07:19, 20 November 2009

Install createrepo

yum install  createrepo

Preparing

Make directory structure

  • A directory called base which holds local copy of RPM's
  • A directory called updates which holds the updates.

On this server which is a PXE install server the RPM's are already resident on the ftp server /var/ftp/install/centos52/CentOS/RPMS which I just link to the repositorie

mkdir -p /var/www/html/Centos/52/yum/updates
ln -s /var/ftp/install/centos52/CentOS/RPMS /var/www/html/Centos/52/yum/base

Creating repository headers

Now create the base repository headers: (Takes a couple of minuttes)
createrepo creates some files in a new repodata directory.

[root@ks ~]# createrepo /var/www/html/Centos/52/yum
[root@ks ~]# ls /var/www/html/Centos/52/yum/repodata
filelists.xml.gz  other.xml.gz  primary.xml.gz  repomd.xml

Updating the repository

Now update the repositorie
NOTE: rsync uses TCP port 873 which need to be open to the internet. Choose update sources from CentOS European Mirrors

/usr/bin/rsync -avrt rsync://mirrors.se.kernel.org/centos/5.2/updates/i386 --exclude=debug/ /var/www/html/Centos/52/yum/updates

Links