Create the Debian Package Repository
There is excellent documentation available from both the debian.org site and the Ubuntu Wiki.
The
Debian Package Repository HowTo provides an in-depth look at how to setup and maintain a Debian package repository.
We'll create a 'trivial' repository with just
source and
binary subdirectories.
Creating the Index Files
dpkg-scanpackages will generate the
Packages file and
dpkg-scansources the
Sources file.
dpkg-scanpackages scans the .deb packages;
dpkg-scansources scans the .dsc files. It is thus necessary to put the .orig.gz, .diff.gz and .dsc files together. The
.changes files are not needed.
Note: for testing the binary packages you might want to create binary packages only.
Create the two index files as follows:
$ cd my-repository
$ dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
$ dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz
The Release file in
/pub/sipx/debian/dists/unstable/main/binary-i386/ looks like this:
Archive: unstable
Component: main
Origin: Calivia GmbH
Label: Calivia Debian repository
Architecture: i386
Creating the Release files
If you want to enable the users of your repository to use Pinning with your repository, you must include a Release file in every directory containing an index file. (You can read more about pinning in the APT HOWTO).
The Release files are simple and short text files of the following form:
Archive: archive
Component: component
Origin: YourCompany
Label: YourCompany Debian repository
Architecture: architecture
- Archive
- The name of the distribution of Debian the packages in this directory belong to (or are designed for), i.e. stable, testing or unstable.
- Component
- The component of the packages in the directory, for example main, non-free, or contrib.
- Origin
- The name of who made the packages.
- Label
- Some label adequate for the packages or for your repository. Use your fantasy.
- Architecture
- The architecture of the packages in this directory, such as i386, sparc or source.
Use the new repository
To install packages from the custom repository, you need to add it to your
/etc/apt/sources.list.