Running a Debian Package Repository
I've started to create installable debian binary packages for the programs I maintain. Well, not the perfect kind of debian package on might expect. apt-get is not getting tired telling the my packages are "not a valid DEB package". Yes, there are things left to do but they are doing their job.
The first thing you need is an HTTP server (ftp will also do but not covered here). Assuming that you have one up and running you have the following things to do.
Server setup
For an apt feed definition of
deb http://myserver.example.com/debian/ ./
you have to create debian directory in your webserver's data root directory. In this directory you have to store the package information (see below).
You deb packages can go anywhere else, this will be configured in the package descriptions. For this example I assume that the packages go also into the debian directory.
Providing package information
The information about the packages on your server is read from "something like" debian package control files, with the addition of
- a Filename entry giving the URL relative to your repository base address,
- a Size entry giving the exact size of the package in bytes.
In addition all control-like files are concatenated together with a single blank line between the entries and gzip'ed into a single Packages.gz.
An example. If your control file contains
Package: tcpproxy Version: 2.0.0beta11-1 Section: net Priority: optional Architecture: i386 Depends: libc6 (>= 2.2.4-4) Installed-Size: 61 Maintainer: Wolfgang Zekoll <wzk@quietsche-entchen.de> Description: tcpproxy is a transparent TCP proxy.
the packages entry would be
Package: tcpproxy Version: 2.0.0beta11-1 Section: net Priority: optional Architecture: i386 Depends: libc6 (>= 2.2.4-4) Installed-Size: 61 Filename: tcpproxy_2.0.0beta11-1_i386.deb Size: 27030 Maintainer: Wolfgang Zekoll <wzk@quietsche-entchen.de> Description: tcpproxy is a transparent TCP proxy.
under the assumption that the file tcpproxy_2.0.0beta11-1_i386.deb
- is under the URL http://myserver.example.com/debian/tcpproxy_2.0.0beta11-1_i386.deb, and
- it's size is 27030 bytes.
If you decide to put your packages in another directory that the main debian directory, e.g. debian/packages the package description would be
Package: tcpproxy Version: 2.0.0beta11-1 Section: net Priority: optional Architecture: i386 Depends: libc6 (>= 2.2.4-4) Installed-Size: 61 Filename: packages/tcpproxy_2.0.0beta11-1_i386.deb Size: 27030 Maintainer: Wolfgang Zekoll <wzk@quietsche-entchen.de> Description: tcpproxy is a transparent TCP proxy.
The thing to notice here is that the Filename: entry gives the package's address relative to the feed's base directory (http://myserver.example.com/debian/ in this example).
Another (more complex) feed definition is
deb http://myserver.example.com/debian/ unofficial myfeed
In this case the Packages.gz must be placed in the directory debian/dists/unofficial/local/binary-i386 relative to the HTTP server's document root. Again, the packages can be placed somewhere on your server as long as the Filename entry points to it.
You would choose such a setup if you have more than one feed, like e.g. packages for stable, unstable and experimental Debian installations.
When setting up a feed server you should keep in mind that you have access and error logfiles that you can consult if someting is not working as expected.
Release file
Beside the package information there is a file called Release which is expected by apt-get. For me it's not clear what's in the file (and it works without) but it seems to be some descriptive information about your feed.
Something like this
Archive: unstable Origin: myownfeed Label: myownfeed Architecture: i386
does the job.