Bug#565364: python-apt: Auto flag attribute in apt_get.Package is always 0
Hi,
thanks for your bugreort.
To make it work, please use:
import apt_pkg
apt_pkg.InitConfig()
apt_pkg.InitSystem()
cache=apt_pkg.GetCache()
depcache=apt_pkg.GetDepCache(cache)
for pkg in cache.Packages:
if pkg.CurrentVer and depcache.IsAutoInstalled(pkg):
print pkg.Name
Or the high level bindings (that is recommended):
import apt
cache = apt.Cache()
for pkg in cache:
if pkg.is_auto_installed:
print pkg.name
I need to investigate why the flag is wrong, but IIRC its a property
of the depcache, not the pkgcache
Cheers,
Michael
Reply to: