summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'apt/cache.py')
-rw-r--r--apt/cache.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/apt/cache.py b/apt/cache.py
index 737061ad..414bd982 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -80,6 +80,10 @@ class Cache(object):
if progress is None:
progress = apt.progress.OpProgress()
self._run_callbacks("cache_pre_open")
+
+ # Make changes to Dir::State::Status work again, by reinitialising
+ # the system.
+ apt_pkg.init_system()
self._cache = apt_pkg.Cache(progress)
self._depcache = apt_pkg.DepCache(self._cache)
self._records = apt_pkg.PackageRecords(self._cache)