/usr/bin/unattended-upgrade:UnboundLocalError:/usr/bin/unattended-upgrade@1991:main:do_auto_remove
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unattended-upgrades (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Low
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Unattended-upgrades crashes while auto-removing kernel packages.
[Test Case]
1. Install kernel packages to be automatically removed:
# eatmydata apt install linux-image-
# apt-mark auto linux-image-
# /etc/kernel/
2. Set up u-u to perform action in non-minimal steps:
# grep Minimal /etc/apt/
Unattended-
3. Run u-u in dry-run mode.
Observe it failing with not fixed versions:
# unattended-upgrade --dry-run
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/bin/
options.verbose or options.debug, options.dry_run)
File "/usr/bin/
if res:
UnboundLocalError: local variable 'res' referenced before assignment
Observe the fixed version running properly:
# ./unattended-
#
[Regression Potential]
* The fix is very small and isolated, but a programming error could cause the misreporting of the success of auto-removals. Considering the size and simplicity of the change, regressions here seem unlikely.
[Original Bug Text]
The Ubuntu Error Tracker has been receiving reports about a problem regarding unattended-
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://
Changed in unattended-upgrades (Ubuntu Bionic): | |
status: | New → Confirmed |
Changed in unattended-upgrades (Ubuntu Cosmic): | |
status: | New → Fix Released |
description: | updated |
description: | updated |
This bug was fixed in the package unattended-upgrades - 1.5ubuntu3
---------------
unattended-upgrades (1.5ubuntu3) cosmic; urgency=medium
* Skip already adjusted packages from being checked for readjusting.
This makes it clearer that the recursion ends and can also be a bit quicker.
(LP: #1790687)
* Fix PEP 8 warnings.
Also ignore "W503 line break before binary operator" because it will
become the best practice.
* Don't crash on missing dpkg log file (LP: #1795692)
* do_auto_remove() is successful unless a commit() operation fails
(LP: #1795696)
* Check only dowloaded .deb files for conffile prompts (LP: #1796100)
-- Balint Reczey <email address hidden> Sun, 07 Oct 2018 23:16:17 +0200