unattended upgrade deleted my custom locales

Bug #1886843 reported by Bruno Haible
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Ubuntu version: 16.04.1 LTS (Xenial).
$ lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

On my system, I need a couple of locales that are not installed by default: fa_IR, fr_FR.ISO-8859-1, fr_FR.UTF-8, ja_JP.EUC-JP, tr_TR.UTF-8, zh_CN.GB18030. I generated them many months ago, using these commands:

sudo localedef -i fa_IR -f UTF-8 fa_IR
sudo localedef -i fr_FR -f ISO-8859-1 fr_FR.ISO-8859-1
sudo localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
sudo localedef -i ja_JP -f EUC-JP ja_JP.EUC-JP
sudo localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
sudo localedef -i zh_CN -f GB18030 zh_CN.GB18030

Today, I found that these locales are missing.

$ ls -l /usr/lib/locale/locale-archive
-rw-r--r-- 1 root root 4570528 Jul 7 06:57 /usr/lib/locale/locale-archive

The file /usr/lib/locale/locale-archive was modified yesterday, outside of office hours.

The file /var/log/apt/history.log shows that there was an unattended upgrade of the locale database at this time:

Start-Date: 2020-07-07 06:57:13
Commandline: /usr/bin/unattended-upgrade
Upgrade: libc6-dev-x32:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libnss3-nssdb:amd64 (2:3.28.4-0ubuntu0.16.04.11, 2:3.28.4-0ubuntu0.16.04.12), libc6-dev-i386:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libc6-dbg:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libc6-dev:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libc6-dev:i386 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libc6:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libc6:i386 (2.23-0ubuntu11, 2.23-0ubuntu11.2), linux-base:amd64 (4.5ubuntu1.1~16.04.1, 4.5ubuntu1.2~16.04.1), locales:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11.2), libc-bin:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11.2), libc6-x32:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libc6-i386:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), libopenexr22:amd64 (2.2.0-10ubuntu2.2, 2.2.0-10ubuntu2.3), libc-dev-bin:amd64 (2.23-0ubuntu11, 2.23-0ubuntu11.2), multiarch-support:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11.2), libnss3:amd64 (2:3.28.4-0ubuntu0.16.04.11, 2:3.28.4-0ubuntu0.16.04.12), glibc-doc:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11.2)
End-Date: 2020-07-07 06:57:58

As you can see, the 'locales' packages was upgraded.

Apparently it has replaced the /usr/lib/locale/locale-archive file with a new copy, that contains only the default locales (English and German locales, since German is my preferred language).

It would be better if the 'locales' package, during an upgrade, would
1. take the list of installed locales (command 'locale -a'),
2. after deleting the /usr/lib/locale/locale-archive file, regenerate each such locale, using a command 'localedef -i LOCNAME -f ENCODING LOCNAME.ENCODING'.

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1886843/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → glibc (Ubuntu)
Revision history for this message
Balint Reczey (rbalint) wrote :

Please use 'sudo dpkg-reconfigure locales' to generate additional locales which are preserved during upgrades.

Changed in glibc (Ubuntu):
status: New → Invalid
Revision history for this message
Bruno Haible (bruno-clisp) wrote :

Thanks for the hint. That should work for next time.
Although I would have found it nicer if the distro had not created an additional layer on top of 'localedef'.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.