Score:3

How does a apt repository work to find the available packages?

ro flag

For example i have this apt ubuntu (21.10) repository for postgres in my sources.list.d:

deb http://apt.postgresql.org/pub/repos/apt/ impish-pgdg main 13

Which results in apt-get update to fetch:

Hit:4 http://apt.postgresql.org/pub/repos/apt impish-pgdg InRelease
Get:5 http://apt.postgresql.org/pub/repos/apt impish-pgdg/main amd64 Packages [247 kB]

By default the shown packages for example via apt-cache policy postgresql-plpython3-13 only show the latest minor version of that package (= 13.5):

postgresql-plpython3-13:
  Installed: (none)
  Candidate: 13.5-1.pgdg100+1
  Version table:
     13.5-1.pgdg100+1 500
        500 http://apt.postgresql.org/pub/repos/apt impish-pgdg/main amd64 Packages

I took a deep look inside the repository structure and found various older minor versions for those packages located in: http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-13/

A part of the directory structure is like:

dists/
  impish-pgdg/
  (...)
    13/
    main/
    InRelease
    Release
    (...)
pool/
  main/
    p/
    (...)
      postgresql-13/
      (...)
        postgresql-plpython3-13_13.5-1.pgdg100%2B1_amd64.deb
        (...)
  • Question: How is the algorithm where apt searches for packages? How can i tell apt or configure my source list entry to show/remember all minor versions of a package available on the repository?

For example the package above in version 13.1, not 13.5?

Score:1
zw flag

Really APT first scans dists folder. In your case it is http://apt.postgresql.org/pub/repos/apt/dists/impish-pgdg/ .

It fetches InRelease to determine available components:

Components: main 9.6 10 11 12 13 14

So you will get the packages defined in Packages file of the main, 9.6, 10, 11, 12, 13, 14 versions.

The Packages file for 13 exactly contain fields:

Version: 13.5-1.pgdg21.10+1

so this is why 13.5 is available from main 13 sources.list line.

FireEmerald avatar
ro flag
So this means there is no way to get the other (older) versions from the subdirectory inside `pool` to be listed by apt when these versions are not part of the _Packages_ file(s)?
N0rbert avatar
zw flag
Yes, this is how it works. See details at https://wiki.debian.org/DebianRepository/Format .
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.