Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1002636: debconf: dpkg-reconfigure locales crashes because /sbin is not in $PATH

135 views
Skip to first unread message

Lucio Messina

unread,
Dec 26, 2021, 5:00:03 AM12/26/21
to
Package: debconf
Version: 1.5.79
Severity: normal
Tags: l10n newcomer
X-Debbugs-Cc: luciotutt...@inventati.org

Dear Maintainer,

STEP TO REPRODUCE:
1. have a debian fresh install
2. run `/usr/sbin/dpkg-reconfigure locales`
3. select the locales to generate
4. select the default locale

EXPECTED OUTCOME
locales are regenerated without errors

ACTUAL OUTCOME
dpkg-reconfigure crashes with error
/var/lib/dpkg/info/locales.postinst: 64: locale-gen: not found

REASON
/usr/sbin is not in PATH by default, so the executable for locale-gen is not
found. Manually running `/usr/bin/locale-gen` finishes the process as expected.
Adding /usr/sbin to PATH before running `locale-gen` also works.


-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.15.0-2-amd64 (SMP w/8 CPU threads)
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 debconf depends on:
ii perl-base 5.32.1-6

Versions of packages debconf recommends:
ii apt-utils 2.3.13
ii debconf-i18n 1.5.79

Versions of packages debconf suggests:
pn debconf-doc <none>
pn debconf-kde-helper <none>
pn debconf-utils <none>
ii libgtk3-perl 0.038-1
pn libnet-ldap-perl <none>
pn libterm-readline-gnu-perl <none>
ii perl 5.32.1-6
ii whiptail 0.52.21-5+b1

-- debconf information:
debconf/frontend: Dialog
debconf-apt-progress/media-change:
debconf/priority: high
debconf-apt-progress/info:
debconf-apt-progress/title:
debconf-apt-progress/preparing:

Colin Watson

unread,
Dec 26, 2021, 8:20:04 AM12/26/21
to
On Sun, Dec 26, 2021 at 10:52:47AM +0100, Lucio Messina wrote:
> STEP TO REPRODUCE:
> 1. have a debian fresh install
> 2. run `/usr/sbin/dpkg-reconfigure locales`
> 3. select the locales to generate
> 4. select the default locale
>
> EXPECTED OUTCOME
> locales are regenerated without errors
>
> ACTUAL OUTCOME
> dpkg-reconfigure crashes with error
> /var/lib/dpkg/info/locales.postinst: 64: locale-gen: not found
>
> REASON
> /usr/sbin is not in PATH by default, so the executable for locale-gen is not
> found. Manually running `/usr/bin/locale-gen` finishes the process as expected.
> Adding /usr/sbin to PATH before running `locale-gen` also works.

dpkg-reconfigure should only be run as root, and root's PATH normally
contains /usr/sbin. It's not dpkg-reconfigure's job to set this up.

Can you explain more about the context in which you ran
"/usr/sbin/dpkg-reconfigure locales" (e.g. how exactly did you acquire a
root shell)?

--
Colin Watson (he/him) [cjwa...@debian.org]

Lucio Messina

unread,
Dec 26, 2021, 12:30:04 PM12/26/21
to

Hi Colin,
thank you for your fast reply.

I confirm that root's PATH does not contain /usr/sbin in my debian
testing (bookworm) fresh install. I acquired the root shell using the
`su` command. Then I ran `dpkg-reconfigure locales` but I got the error
`bash: dpkg-reconfigure: command not found` so I ran
`/usr/sbin/dpkg-reconfigure locales` as explained before.

Best regards,
Lucio

Colin Watson

unread,
Dec 26, 2021, 1:30:03 PM12/26/21
to
Control: reassign -1 util-linux
Control: forcemerge -1 907194

On Sun, Dec 26, 2021 at 06:18:23PM +0100, Lucio Messina wrote:
> I confirm that root's PATH does not contain /usr/sbin in my debian testing
> (bookworm) fresh install. I acquired the root shell using the `su` command.
> Then I ran `dpkg-reconfigure locales` but I got the error `bash:
> dpkg-reconfigure: command not found` so I ran `/usr/sbin/dpkg-reconfigure
> locales` as explained before.

"su" preserves the calling user's PATH by default. Use "su -l" or "sudo
-i" instead, and see https://bugs.debian.org/907194.

Lucio Messina

unread,
Dec 29, 2021, 6:40:03 AM12/29/21
to

I see now,

thank you for the clarification and for your time.

Lucio
0 new messages