Root cause: a translated template placeholder in the French translation.
▎
▎ trigger_update_notifier() in /usr/lib/update-notifier/package-data-downloader 
reads /usr/share/update-notifier/package-data-downloads-failed (and 
-permanently). Each of those files holds all translations at once, about 75 
Description-<lang> blocks. It then calls 
string.Template(input).substitute({'packages': ...}) on the whole file. In the 
fr section the placeholder itself was translated:
▎
▎ msgid  "  $packages"
▎ msgstr "  $paquets"
▎
▎ (/usr/share/locale/fr/LC_MESSAGES/update-notifier.mo; visible at line ~302 of 
package-data-downloads-failed and ~296 of -permanently.)
▎
▎ As a result, any failed package data download crashes with KeyError: 
'paquets' on every system, whatever the locale. My system is en_US.UTF-8. The 
crash leaves update-notifier-common half-configured (iF), which then fails 
every later apt/dpkg run, including unattended-upgrades.
▎
▎ Still present in Ubuntu 26.04, update-notifier-common 3.207.2. Reproduced 
with ttf-mscorefonts-installer 3.8.1ubuntu2 when its SourceForge mirror timed 
out.
▎
▎ Suggested fixes:
▎ 1. Correct the fr translation in Launchpad Translations, so it keeps the 
placeholder as $packages.
▎ 2. Make the code robust against bad translations, e.g. safe_substitute(), or 
substitute per language block and skip broken ones. Bug 1003100 (paquetes, 
2012) was the same class of problem.
▎
▎ Workaround: download the data files manually, run the package's install 
script, touch /var/lib/update-notifier/package-data-downloads/<package> (and 
remove the .failed / .permanent-failure files), then dpkg --configure -a.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2126034

Title:
  package update-notifier-common 3.200 failed to install/upgrade:
  podproces zainstalowany pakiet update-notifier-common skrypt post-
  installation zwrócił kod błędu 1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2126034/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to