You don't need to browse the repo as a directory. Knowing all the repo properties (from the string you use to add the repo), you are guaranteed to know the precise URL (a direct link) of the release file. Then you download it, and it's a text file with a list of essential repository information. The structure of a repository and its control files is explained in the wiki.
You'd start with the file $REPO_BASE/dists/$DIST/InRelease
. These REPO_BASE
and DIST
are determined from your line in sources file:
deb https://artifacts.elastic.co/packages/7.x/apt stable main
# REPO_BASE DIST COMPONENT
In this case, release file has the following direct url: https://artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease
. It contains list of other repository files, including Contents and Packages files for each architecture.
Each Packages file is a text file with descriptions of all packages in the repo for the component. For instance, https://artifacts.elastic.co/packages/7.x/apt/dists/stable/main/binary-arm64/Packages
lists all ARM64 binary compiled packages for your repo. The formula for the link is $REPO_BASE/dists/$DIST/$COMPONENT/binary-$ARCH/Packages
.
And then, you can also calculate the link to each deb file in the repo. Each package in the above Packages file has a Filename
item. You'd build the deb link using the formula: $REPO_BASE/$Filename
. For example, for the packetbeat
it happens to be https://artifacts.elastic.co/packages/7.x/apt/pool/main/p/packetbeat/packetbeat-7.8.0-arm64.deb
.
This is exactly the way Apt itself works, and this is the way Ubuntu's utility you mentioned works.
Disabling directory listing on the Debian repository is silly. The sole reason for existence of the repository is exactly to provide that information, so disabling another human-convenient way to see it is beyond my understanding.