Debian Repository HOWTO

2019-06-10
by Gernot Walzl

Final file structure

find . | sort

./dists
./dists/stretch
./dists/stretch/InRelease
./dists/stretch/main
./dists/stretch/main/binary-armhf
./dists/stretch/main/binary-armhf/Packages
./dists/stretch/main/binary-armhf/Packages.gz
./dists/stretch/Release
./dists/stretch/Release.gpg
./pool
./pool/main
./pool/main/...
...

Creating Packages index

dpkg-scanpackages -m pool > dists/stretch/main/binary-armhf/Packages
gzip -kn9 dists/stretch/main/binary-armhf/Packages

Creating Release file

apt-release.conf

APT {
  FTPArchive {
    Release {
      Origin "Raspbian";
      Label "Raspbian";
      Suite "stable";
      Codename "stretch";
      Architectures "armhf";
      Components "main";
    };
  };
};

rm dists/stretch/Release
RELEASE=$(apt-ftparchive -c apt-release.conf release dists/stretch)
echo "$RELEASE" > dists/stretch/Release

Sign Release file

gpg --digest-algo SHA256 --clearsign -o InRelease Release
gpg --digest-algo SHA256 -abs -o Release.gpg Release