[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to get some data from the apt db from python?



Hello,

I'm writing to this list asking for help on accessing the apt database
- I hope it's the right place. If not, please forgive me.

I'll start from the last line: How can I get the list of installed
packages and their dependencies, from Python? By "dependencies" I
mean, for each installed package, the list of installed packages that
it depends on.

Now for why I need this: I have the feeling that my computer is
getting filled with packages that I don't really want. This is caused
by packages that I installed and now don't want, or even packages that
I installed and uninstalled, but didn't uninstall the dependencies.

I thought that what might help me remove unwanted packages is a tool
that will show me the dependencies graph of the packages, as a tree,
starting from the packages that no packages depend on them - those are
the packages that can be removed without affecting any other packages.
Those packages will be the roots of the tree. The tool will let me
easily remove those packages, and will update the tree accordingly. To
avoid making the tree cluttered by packages that I *do* want, there
will be an option to make "virtual packages", which will depend on
whatever packages you like. That way, I will organize all the packages
that I do want into such virtual packages, and any package that I
don't want will get into the list of packages that no other package
depend on, and will quickly be removed.

Do you think it's interesting? Do you know of other similar tools?

Thanks,
Noam



Reply to: