diff --git a/apt_info.py b/apt_info.py index eb1a642..9b1b675 100755 --- a/apt_info.py +++ b/apt_info.py @@ -10,7 +10,6 @@ import apt import collections -import contextlib import os from prometheus_client import CollectorRegistry, Gauge, generate_latest @@ -83,15 +82,6 @@ def _write_reboot_required(registry): def _main(): cache = apt.cache.Cache() - # First of all, attempt to update the index. If we don't have permission - # to do so (or it fails for some reason), it's not the end of the world, - # we'll operate on the old index. - with contextlib.suppress(apt.cache.LockFailedException, apt.cache.FetchFailedException): - cache.update() - - cache.open() - cache.upgrade(True) - registry = CollectorRegistry() _write_pending_upgrades(registry, cache) _write_held_upgrades(registry, cache)