Joachim Breitner

Quickest path to a local apt repository

Published 2015-08-22 in sections English, Debian.

As I’m writing this, DebConf 15 is coming to an end. I spend most of my time improving the situation of the Haskell Packages in Debian, by improving the tooling and upgrading our packages to match Stackage 3.0 and build against GHC 7.10. But that is mostly of special interest (see this mail for a partial summary), so I’d like to use this post to advertise a very small and simple package I just uploaded to Debian:

During one of the discussion here I noticed that it is rather tricky to make a locally built package available to apt-get. The latest version in unstable allows one to install a debian package simply by running apt-get install on it, but in some cases, e.g. when you want a convenient way to list all packages that you made available for local use, this is insufficient.

So the usual approach is to create a local apt repository with your packages. Which is non-trivial: You can use dpkg-scanpackage, apt-ftparchive or reprepro. You need to create the directories, run the commands, add the repository to your local sources. You need to worry about signing it or setting the right options to make apt-get accept it without signing.

It is precisely this work that my new package local-apt-repository automates for you: Once it is installed, you simply drop the .deb file into /srv/local-apt-repository/ and after the next apt-get update the package can be installed like any other package from the archive.

I chose to use the advanced features that systemd provides – namely activation upon path changes – so works best with systemd as the init system.

If you want to contribute, or test it before it passes the NEW queue, check out the git repository.


JFYI, there was a perl program called “debpool” which recreated the structure of a simple debian repository starting from (signed) packages put in an “incoming” directory.

I used it with success years ago but then it was dropped for Debian.

I don’t know what its status is these days but here is some info about it:

#1 Antonio Ospite am 2015-08-22

Don’t forget apt in experimental will happily take a path to a .deb file and resolve the dependencies without the ugly dpkg -i / apt-get install -f dance. This removes at least some (albeit basic) usecases for having one’s own APT repository.

#2 Chris Lamb am 2015-08-23

quite right. The small advantage that my package provides over this is

  • the ability to have dependencies available and have apt-get pull them in only if needed (e.g. in conjunction with mk-build-deps) and
  • the ability to review the list packages in the local repository.
#3 Joachim Breitner am 2015-08-23

Have something to say? You can post a comment by sending an e-Mail to me at <>, and I will include it here.