dpkg-reconfigure locales is not automized?

Bug #44973 reported by Björn Lindqvist
12
Affects Status Importance Assigned to Milestone
tzdata (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: locales

Sorry for the bad bug description... When you upgrade the locales package, dpkg-reconfigure locales i run after the new package have been installed. When Synaptic (or any of the GUI frontends) runs it appears like the installation has stalled and you have to press the expander so that you can see that you are prompted for input. This happens because tzconfig requests an answer.

It may be a related bug that tzconfig's prompt look like this on my system: Your current time zone is set to TZifv �
�`����MD3��#��ܐ͐���㯐Ӡ�Ñ���
��
��
��|� lr!\c"LT#<E$,6%
'&
                                                                                                                                    'C�'�4�(�%�)��*��+���,���-�ڐ.�ː/t��0d��1]�2r�3=�4R�5
�62x6��8�a9�v�:�C;�X�<�_�=�:�>�A�?�
�@f#�A�9BF�CdD%��EC�FɐG#�G��I�I��J��K��L̿�MN���OnnP���QW��Rle�S7l�TLG�UN�V,)�V�0�XFX��Y�(Z���[
\�]��^�_��`_�a}��b?�c]̐d�e=����g
��g藐h�r�i�y�j�T�k�[�l�qm�=�n�Soh�p�5qQ<rfs1
tE�uv/�v��x÷│ÐÄ≤îِ≥°¦πλ≠™Â£®·≤¤Ž
 
 CETCEST
D⎺ ≤⎺┤ ┬▒┼├ ├⎺ ␌␤▒┼±␊ ├␤▒├? [┼]:

Ideally, re-installation of the locales package through synaptic should not require any user input at all.

Revision history for this message
Martin Pitt (pitti) wrote :

This is the counterpart to bug 30815. Unfortunately nothing we can fix for dapper.

Changed in langpack-locales:
status: Unconfirmed → Confirmed
Revision history for this message
Michael Vogt (mvo) wrote :

I'm unable to reproduce the problem here. Upgrading or reinstalling locales does not ask this question for me on my current dapper system.

Can you please tell me what I have to do to reproduce this?

Thanks,
 Michael

Revision history for this message
Björn Lindqvist (bjourne) wrote :

If you have a locale other than the default, you should be able to reproduce it by typing:

$ sudo dpkg-reconfigure locales
Generating locales...
  [list of locales]
Generation complete.
/var/lib/dpkg/info/locales.postinst: line 75: [: för många argument
Running 'tzconfig' to set this system's timezone.
Your current time zone is set to [binary data dumped, seems to be /etc/timezone in this case]:
<Here you have to press enter>
[more gibberish]
$

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, it seems like something is wrong in the locales.postinst for you. Could you add a line like "echo "timezone: $timezone"" before line 74 in the /var/lib/dpkg/info/locales.postinst script (make a backup of the script first please :)

Revision history for this message
Bill Coffman (bill-coffman) wrote :

#Seems like a variation of this bug, or a side-effect of fix attempts? bug #30622 in particular
 $ sudo dpkg-reconfigure locales
Generating locales...
  en_US.ISO-8859-1... up-to-date
  en_US.UTF-8... up-to-date
Generation complete.
Current default timezone: 'US/Pacific'.
Local time is now: Mon Jul 24 12:10:31 PDT 2006.
Universal Time is now: Mon Jul 24 19:10:31 UTC 2006.
Run 'tzconfig' if you wish to change it.
$ prompt>

The older debian versions (including breazy, see thread http://www.ubuntuforums.org/showthread.php?p=1057783 )
used to bring up a dialog to reconfigure/add locales, etc. Now, dpkg-reconfigure doesn't reconfigure. My focus is on the server, no X pkgs.

Revision history for this message
Björn Lindqvist (bjourne) wrote :

It happened to me again, here is some more info. This happens during dpkg-reconfigure:

Ställer in tzdata (2006p-0ubuntu6.10)
/var/lib/dpkg/info/tzdata.postinst: line 68: [: too many arguments
Running 'tzconfig' to set this system's timezone.
Your current time zone is set to (Two lines of garbled binary data here) Do you want to change that? [n]:

Here is line 68 of /var/lib/dpkg/info/tzdata.postinst:

if [ -f /usr/share/zoneinfo/$timezone ] && [ "$timezone" != Factory ]

And looking back in the file, it seems like the following snippet sets the timezone variable:

if [ "$type" = "configure" ]
then
    if [ -f /etc/timezone ]; then
 timezone=$(cat /etc/timezone)
    else

So it seems like "timezone" is assigned the value of /etc/timezone. On my system, /etc/timezone is a symbolic link to "/usr/share/zoneinfo/Europe/Stockholm". And:

$ file /usr/share/zoneinfo/Europe/Stockholm
/usr/share/zoneinfo/Europe/Stockholm: timezone data
$ cat /usr/share/zoneinfo/Europe/Stockholm
TZifv �
�`����MD (and more binary data ...)

So, obviously, bash complains about:

[ -f /usr/share/zoneinfo/$timezone ]

$timezone is binary data.

Revision history for this message
Martin Pitt (pitti) wrote :

This shouldn't be an issue any more for a long time. The locales package does not ask any console questions any more.

Changed in langpack-locales:
status: Confirmed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Erm, I mean tzdata, but same result. It properly uses debconf nowadays.

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.