Creating a yum repository under Debian

July 2007


We have a server running Debian, but we want to serve packages to machines running Scientific Linux (a RedHat clone). We try to set up a yum repository.

Procedure 69.  Setting up the repository

  1. Creating and populating the repository is fairly simple: create any directory - /srv/ftp/myrepos for out purposes, and copy the rpm-files into it.

  2. Now we need two packages installed: apt-get install yum createrepo

  3. Indexing the repository for the client can be done in two ways:

    1. createrepo /srv/ftp/myrepos for use with newer versions of yum

    2. cd /srv/ftp/myrepos && yum-arch . for use with older versions

Now we can configure the client to use our repository by putting the following stanza into /etc/yum.conf:

[My Repository]
name=myrepos
baseurl=ftp://myhost.mynet.com/myrepos/
    

Usage of yum (and other package managers) is nicely described in the Naked Ape's PackageManagerCheatSheet.

[Warning]Warning

There is a catch though: some rpm files will not be accepted by yum-arch, either with a message error public key not available or simply with ignoring bad rpm: <filename>.

createrepo will not complain, but whether it is passing or just silently ignoring I did not test.

Nice repositories to steal from are Dries's and Dag's.