Package: tzdata
Version: 2024a-0+deb12u1
Severity: minor
X-Debbugs-Cc: satw...@disjoint.net

Dear Maintainer,

When installing the tzdata and debconf tries to ask questions and fails
because stdin is not available, the package writes "/UTC" to
/etc/timezone, which doesn't seem to be valid (note the leading slash).
I would expect it to write either "Etc/UTC" or "UTC".

This can happen, for example, during docker builds.  (Example: 
https://github.com/docker-library/buildpack-deps/issues/161)  It's easy
to fix by setting DEBIAN_FRONTEND=noninteractive during install, but it
seems like tzdata should still be able to write the correct default
value to /etc/timezone in this situation.

Example:

root@76562861bcf7:/# apt-get install tzdata < /dev/null
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  tzdata
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 255 kB of archives.
After this operation, 1410 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian sid/main amd64 tzdata all 2024a-4 [255 kB]
Fetched 255 kB in 0s (1803 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package tzdata.
(Reading database ... 6627 files and directories currently installed.)
Preparing to unpack .../tzdata_2024a-4_all.deb ...
Unpacking tzdata (2024a-4) ...
Setting up tzdata (2024a-4) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based 
frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 
79.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

  1. Africa   3. Antarctica  5. Asia      7. Australia  9. Indian    11. Etc
  2. America  4. Arctic      6. Atlantic  8. Europe     10. Pacific
Geographic area:
Use of uninitialized value $_[1] in join or string at 
/usr/share/perl5/Debconf/DbDriver/Stack.pm line 112.

Current default time zone: '/UTC'
Local time is now:      Tue Aug 13 13:29:39 UTC 2024.
Universal Time is now:  Tue Aug 13 13:29:39 UTC 2024.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

Use of uninitialized value $val in substitution (s///) at 
/usr/share/perl5/Debconf/Format/822.pm line 84, <GEN6> line 4.
Use of uninitialized value $val in concatenation (.) or string at 
/usr/share/perl5/Debconf/Format/822.pm line 85, <GEN6> line 4.

root@76562861bcf7:/# cat /etc/timezone
/UTC

-- System Information:
Debian Release: 12.6
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-23-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages tzdata depends on:
ii  debconf [debconf-2.0]  1.5.82

tzdata recommends no packages.

tzdata suggests no packages.

-- debconf information excluded

Reply via email to