Small http based apt repository howto


Imagine that you have created and released some rpms, it is now possible to provide the same rpms via your own apt repository on your internet service provider (ISP) http pages. The only thing you need is enough disk space at your ISP.

The procedure

  1. Make sure you've the tools provided by the apt-rpm project installed.
    Test this by executing: "which genbasedir" and "which genpkglist", which must result in respectively: /usr/bin/genbasedir and /usr/bin/genpkglist or something similar. Or check if you have the rpm "apt" installed: rpm -qi apt.

  2. Create a directory structure like

    here <name> may be any arbitrary name. However, easy to understand names are: unstable, tested and stable. You're adviced to use 1 of those 3.

    Example: /home/joe/public_html/<i386>/RPMS.unstable

  3. Copy your binary rpms to the directory: ..../<architecture>/RPMS.<name>

  4. Copy your source rpms to the directory: ..../<architecture>/SRPMS.<name>

  5. Use the tool "genbasedir" to create the apt database(s). The databases will end up in: ..../<architecture>/base. The directory base is created by the tool genbasedir.
    genbasedir --progress --flat --bz2only /home/joe/public_html/i386 tested
    genbasedir --progress --flat --bz2only /home/joe/public_html/i386

  6. Create the same relative directory structure as created under 2) in your webserver (remote/ISP environment). This is the directory structure:
    <architecture>/RPMS.<name> and

  7. You must now upload the files located at your harddisk in the directories: base, RPMS.<name> and SRPMS.<name> to the same directories in your webserver environment.

  8. It's now time to compose the uri that will be stored in the /etc/apt/sources.list file at your client's system.

    Let's assume that you created the directory structure under your home directory at the webserver and the url for your webserver is:

    This will result in the following uri:
    rpm     <architecture>     <name>
    rpm-src     <architecture>     <name>

    rpm     i386     tested
    rpm-src     i386     tested

  9. You now have created an APT repository. Last thing to do is to announce your repository to the world.

An example of an http based apt repository can be found here (homevision) and here (apt for SuSE).

The /etc/apt/sources.list uri for this repository is:
rpm i386 untested

The archive name "i386" above may be replaced by e.g. <distribution>/<version>-<architecture>
This would than result in
rpm okna/2002-i386 untested

Have fun. I'm looking forward to many http based apt repositories!

Last modified: 22 April 2007