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:
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”:
Architectures: i386 amd64 source
Description: Alveonet specific (or backported) packages
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:
Successfully created './dists/hardy/Release.gpg.new'
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