--- /usr/bin/unattended-upgrade 2019-03-25 14:17:56.000000000 -0300 +++ unattended-upgrade 2019-04-11 08:59:37.827115669 -0300 @@ -688,13 +688,21 @@ if should_stop(): return False pkg = cache[pkgname] - if pkg.is_upgradable: - cache.mark_upgrade_adjusted(pkg, - from_user=not pkg.is_auto_installed) - elif not pkg.is_installed: - cache.mark_install_adjusted(pkg, from_user=False) - else: + try: + if pkg.is_upgradable: + cache.mark_upgrade_adjusted(pkg, + from_user=not pkg.is_auto_installed) + elif not pkg.is_installed: + cache.mark_install_adjusted(pkg, from_user=False) + else: + continue + except NoAllowedOriginError: + cache.clear() continue + except: + cache.clear() + raise + # double check that we are not running into side effects like # what could have been caused LP: #1020680 if not check_changes_for_sanity(cache, allowed_origins, blacklist,