Rhodderz Rhodderz - 9 days ago 8
Java Question

Reading Linux Repositories from Third Party

I am trying to create an app that would be able to generate kickstart scripts (along other things) and for one of the things to add was a list of packages you can install (obviously wont display them all, but will have a function to allow you to know if the package is available).
The problem I am finding is finding any documentation on how yum/apt read their repositories.
Does anyone know on where to find documentation on this sort of thing or if there is an open sourced app that does a simular thing (reading the repository that is)

Answer

APT and YUM repositories have different internal metadata formats:

  • APT: Can be parsed with libapt, or your own tools. It is pretty straightforward as the metadata format isn't too complicated.
  • YUM: Can be parsed with any XML library; the metadata is stored as XML and easily parsed with any XML library for any major programming language.

You can learn more about YUM repository metadata in this blog post. You can learn more about APT repository metadata in this blog post.

Comments