I have an apt repository using an apache server at /var/www/organization.org/
the file structure is
.
+- Release
+- dists/
+- stable/
| +- main/
| | +- binary-all/
| | | +- Packages.gz
| | | +- package1.deb
| | | +- package2.deb
| | +- binary-amd64/
| | | +- Packages.gz
| | | +- package1.deb
| | | +- package2.deb
| | +- binary-arm64/
| | | +- Packages.gz
| | | +- package1.deb
| | | +- package2.deb
| +- contrib/
| | +- [...]
| +- non-free/
| | +- [...]
+- testing/
+- [...]
+- unstable/
+- [...]
And I have this in my source.list
deb http://server_url stable main contrib non-free
When I run
sudo apt update
, things go smoothly.
When I do sudo apt install package_name
, it cannot find any package.
It turns out that in the Release
file, it uses this path Filename: /var/www/organization.org/binary-all/package_name.deb (missing dists/stable/main).
So when I add a symlinks like this binary-all -> dists/stable/main/binary-all/
, I have no issues installing the packages. So everything works, but this is a hack which prevents actually working with unstable/ and testing/ folders because the symlinks are at the root besides Release and dists/.
This is the script that I use to generate Packages.gz and the Release file, which might be relevant.
#!/bin/bash
APT_REPO_DIR=/var/www/organization.org/
DISTS_DIR=$APT_REPO_DIR/dists
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
NO_COLOR='\033[0m'
pushd dists
for stability_directory in */; do # Usually called: stable, unstable, testing
echo -e "Indexing directories under ${YELLOW}$stability_directory${NO_COLOR}"
pushd $stability_directory
for license_directory in */; do # Usually called: main, contrib, non-free
echo -e "Indexing ${BLUE}$license_directory${NO_COLOR}"
pushd $license_directory
for binary_directory in `find binary-* -type d`; do # binary-amd64, binary-arm64...
dpkg-scanpackages $binary_directory | gzip -9c > $binary_directory/Packages.gz
done
popd
done
popd
done
popd
dpkg-scanpackages $APT_REPO_DIR | tee $APT_REPO_DIR/Release > /dev/null