Since several years, I have some Ubuntu/Debian repositories on my servers for some custom packages and/or some local backports. I use to have my hand-made repositories, and mrpouit introduced me reprepro. It covers almost all the features we can expect from a package repository and it’s quite easy to setup. Here is a quick installation process on Ubuntu Hardy.

# sudo apt-get install reprepro
# mkdir /srv/reprepro
# cd /srv/reprepro
# mkdir conf dists incoming indices logs pool project tmp

Let’s configure our repository:
# cd conf
We will have three files:
* “distributions”: the distributions the repository support
* “incoming”: what to do with the incoming directory
* “uploaders”: uploaders authorization

Let’s begin with uploaders. We will make our life easy: all uploaders have an ssh access on the server, so we will limit with Unix file system access to this directory. You can limit with gpg key, but we will not do that. Here our uploaders file:

allow * by unsigned

Here is our incoming file:

Name: default
IncomingDir: incoming
TempDir: tmp
Allow: hardy hardy-backports
Cleanup: on_deny on_error

Our default queue is called “default”, it take files from incoming, temp directory is “tmp”, and by default, it goes in intrepid.

Let’s have a look to distributions file. You have a section for each distribution in your configuration file. We describe here a sample for “hardy”:

Origin: Alveonet
Label: Alveonet
Suite: hardy
Codename: hardy
Version: 8.04
Architectures: i386 amd64 source
Components: main
Description: Alveonet specific (or backported) packages
SignWith: xxxxxxxxx
DebOverride: ../indices/override.hardy.main
UDebOverride: ../indices/override.hardy.main.debian-installer
DscOverride: ../indices/override.hardy.main.src
DebIndices: Packages Release . .gz .bz2
UDebIndices: Packages . .gz .bz2
DscIndices: Sources Release .gz .bz2
Contents: . .gz .bz2

For the full explanation, you should refer to the reprepro manual. Most of the parameters are explicit, and this is the advised configuration.

Let’s create our GPG key. Be warned that you have to do that in root, not with sudo otherwise it will go in your home directory.

# gpg --gen-key

Answer the question with the entity that run your package repository. Insert your key id (found with gpg --list-secret-keys) in the distribution file.

You have to touch the override (for now, we will let them empty) :

# cd /srv/reprepro/indices
# touch override.hardy.main
# touch override.hardy.main.debian-installer
# touch override.hardy.main.src

You can verify that it’s all functional with exporting the (empty) repository:

# reprepro -Vb /srv/reprepro export

You should see on your console something like the following:

Exporting hardy...
generating Contents-i386...
generating Contents-amd64...
Successfully created './dists/hardy/'
Exporting hardy...
Created directory "./dists/hardy"
Created directory "./dists/hardy/main"
Created directory "./dists/hardy/main/binary-i386"
Created directory "./dists/hardy/main/binary-amd64"
Created directory "./dists/hardy/main/source"

For uploading, nothing more easier. When building your package, you have to copy in the incoming directory the “.changes” and all the files listed here (the .dsc, .diff.gz and .orig.tar.gz). And then launch the command:

# reprepro -Vb /srv/reprepro processincoming default

4 thoughts on “Setup your Debian/Ubuntu repository with reprepro

  1. Bernhard R. Link

    The “default” after “export” seems erroneous. exports wants either no arguments to export all distributions, or the name of an distribution (in this example it would be “hardy”). “default”
    is the name of an incoming queue (so suiteable as argument to processincoming, but not to export).

  2. Hi Bernhard, thanks for noticing, I have updated the post. Regards.

  3. Marc A. Brown

    Dear Lionel,
    Concerning the incoming file, you wrote “Our default queue is called “default” … it goes in intrepid”. However, it seems that it goes by default to hardy, isn’t?

  4. Sasikiran

    I’ve tried this with precise distribution. But for few debians while forming a repository i’m getting the below error.

    No section given for ‘galera’, skipping.
    No section given for ‘mysq-server-wsrep’, skipping.

    Can you please guide me to resolve this issue

Share Your Thought