1

This question already has an answer here:

How I can list all packages a apt repository serves? Specifically before adding the repository to my system would be preferred.

marked as duplicate by muru, Mark Kirby, Organic Marble, karel, Zanna Oct 7 '17 at 19:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

The best option I know is to reproduce the http get apt generates, by hand, and grep it for packages; something like

Check the deb line of the repository,

$ cat /etc/apt/sources.list.d/<name>.list
deb <url> <dist> <name>

Build a request like: (this can be tricky)

$ curl -H 'User-Agent: Debian APT-HTTP/1.3' <url>/dists/<dist>/Release
# or $ curl -H 'User-Agent: Debian APT-HTTP/1.3' <url>/dists/<dist>/Release.gz | gunzip
Codename: <dist>
Architectures: amd64
Components: <name>
MD5Sum:
 ......66b4456ffdb000e8208d5d8ee5           287832 <name>/binary-amd64/Packages
 ......b4b8e5fe8d2d53588e745a3d20            47099 <name>/binary-amd64/Packages.gz
 ......d98f00b204e9800998ecf8427e                0 <name>/binary-i386/Packages
 ......9941158dbf2ac8332307610a5b               20 <name>/binary-i386/Packages.gz
...

That will tell you about the releases on this repository server Build a second request:

$ curl -H 'User-Agent: Debian APT-HTTP/1.3' <url>/dists/<dist>/<name>/binary-amd64/Packages | grep Package: | uniq 
# or $ curl -H 'User-Agent: Debian APT-HTTP/1.3' <url>/dists/<dist>/<name>/binary-amd64/Packages.gz | gunzip | grep Package: | uniq 
Package: mypacakge
Package: myotherpacakge

Change your arch as necessary, the previous release file should describe the paths and architectures well.


this is pretty tedious and heavy lifted, I hope someone can recommended a better option for this kind of check.

Not the answer you're looking for? Browse other questions tagged or ask your own question.