I want to be able to look at local .deb files and at remote repositories and deduce dependencies etc so that I can build my own repositories and partial mirrors (probably by creating config files for reprepro
).
The challenge is that many of the command-line tools to help with this (apt-rdepends etc) assume that you're running on the target system and make use of your local apt cache, whereas I'll often be handling stuff for different Ubuntu and Debian distributions from the one I'm currently running on, so I'd like to do this a bit more at arm's length.
The capable but very poorly-documented python-apt packages let me examine .deb files on the local filesystem and pull out dependencies. I'm now wondering if there are similar tools to parse the Packages.gz files from repositories? (It's not too tricky, but I don't want to reinvent the wheel!)
The overall goal is to create and maintain two repositories: one with our own packages in, and a partial mirror of an Ubuntu distribution with some known required packages plus anything that they, or our own ones, depend upon.
A very effective way is to create local apt caches for all the relevant distributions. The tool chdist
from the devscripts
package allows you to create a number of these caches without the need to use root privileges. You can then use the tools you are used to (e.g. apt-rdepends) to query those caches by wrapping them up in chdist
. You can even point python-apt at your local cache using the rootdir
keyword argument to apt.cache.Cache
where you can then resolve dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With