Warnings with 'locales' in 'debian-12-minimal'-based template?

I have started to work on personalized templates based on ‘debian-12-minimal’.

When I install the ‘qubes-core-agent-passwordless-root’ package I receive the following warnings:


    [vr@dom0 ~]$ 
    [vr@dom0 ~]$ qvm-run -u root vr-aqt-dl12-00 xterm
    Running 'xterm' on vr-aqt-dl12-00

    ###

    root@vr-aqt-dl12-00:~# 
    root@vr-aqt-dl12-00:~# apt update
    Hit:1 https://deb.debian.org/debian bookworm InRelease
    Hit:2 https://deb.debian.org/debian-security bookworm-security InRelease
    Hit:3 https://deb.qubes-os.org/r4.2/vm bookworm InRelease
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    All packages are up to date.
    root@vr-aqt-dl12-00:~# 
    root@vr-aqt-dl12-00:~# apt install qubes-core-agent-passwordless-root
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      python3-daemon python3-lockfile
    Use 'apt autoremove' to remove them.
    The following NEW packages will be installed:
      qubes-core-agent-passwordless-root
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 20.0 kB of archives.
    After this operation, 45.1 kB of additional disk space will be used.
    Get:1 https://deb.qubes-os.org/r4.2/vm bookworm/main amd64 qubes-core-agent-passwordless-root amd64 4.2.36-1+deb12u1 [20.0 kB]
    Fetched 20.0 kB in 0s (61.3 kB/s)                              
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = (unset),
            LC_ALL = (unset),
            LANG = "en_US.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    Selecting previously unselected package qubes-core-agent-passwordless-root.
    (Reading database ... 20852 files and directories currently installed.)
    Preparing to unpack .../qubes-core-agent-passwordless-root_4.2.36-1+deb12u1_amd64.deb ...
    Unpacking qubes-core-agent-passwordless-root (4.2.36-1+deb12u1) ...
    Setting up qubes-core-agent-passwordless-root (4.2.36-1+deb12u1) ...
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    root@vr-aqt-dl12-00:~# 

Can they be ignored safely - or - what needs to be done to resolve them ?

Thanks in advance for any feedback & suggestions !

Viktor

I think it should be fixed:

Do you have the latest template release installed or older debian-12-minimal template that was released before this fix?

Do you have the latest template release installed or older debian-12-minimal template that was released before this fix?

I updated the ‘debian-12-minimal’ template yesterday!

Maybe just update won’t fix this and you need a fresh template.
You can try to reinstall the template so the latest template version will be installed.

You can try to reinstall the template so the latest template version will be installed.

I’ll try that & report the results.

If it still won’t work then I think you should report this in that github issue.

No change, i.e. I still get the same warnings.

I’ll also report this in the GH issue, as you suggested.

Try running this on the templates derived from debian-12-minimal:

qvm-run --pass-io -u root $TEMPLATE "sed -i 's/^# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen"
qvm-run --pass-io -u root $TEMPLATE "/usr/sbin/locale-gen"
2 Likes

Try running this on the templates derived from debian-12-minimal:

I did - but - was NOT successful …

Based on your feedback I changed your commands from ‘en_US’ to ‘de_DE’ - but - Qubes OS / APT still reports the same / similar issues:

    root@vr-aqt-dl12-00:~# 
    root@vr-aqt-dl12-00:~# apt autoremove                                
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages will be REMOVED:
      python3-daemon python3-lockfile
    0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
    After this operation, 156 kB disk space will be freed.
    Do you want to continue? [Y/n] y
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = (unset),
            LC_ALL = (unset),
            LANG = "en_US.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    (Reading database ... 20860 files and directories currently installed.)
    Removing python3-daemon (2.3.2-1) ...
    Removing python3-lockfile (1:0.12.2-2.2) ...
    root@vr-aqt-dl12-00:~#

Thanks a lot for your support !

Viktor

Have you tried sudo /usr/sbin/dpkg-reconfigure locales in the template?

1 Like

Have you tried sudo /usr/sbin/dpkg-reconfigure locales in the template?

No, I have not …

@ALL : Does anyone have a recommendation on where to start investigating / reading on this topic - other - than the GitHub issue already mentioned earlier ? - I feel ~ lost ~ …

I feel like this should have worked for you, as it does work for me to resolve this same issue. Maybe try it again? Clone debian-12-minimal, run those commands in the new template, reboot it (why not), and then try some apt stuff to see if you get the same apt warnings.

Ok, so you uncomment a line specifying a LOCALE in /etc/locale.gen … that LOCALE should be set to whatever system locale you have, not blindly to en_US.UTF-8.
On the other hand, keeping en_US.UTF-8 reduces the fingerprinting surface.
But all in all, looking at the warning message, perl is falling back to LC_ALL=C which is a sane default. Maybe the best thing would be to set this manually.

1 Like

I feel like this should have worked for you, as it does work for me to resolve this same issue. Maybe try it again? Clone debian-12-minimal, run those commands in the new template, reboot it (why not), and then try some apt stuff to see if you get the same apt warnings.

I re-did it once more & used your exact commands, i.e. ‘en_US …’ and not ‘de_DE …’ as in my first attempt. - Now the warnings are gone !

I still do not understand why ~ american ~ locales are required & WHY the previous attempt with ~ german ~ locales failed.

That’s why I asked for additional material to read & stated that I feel ‘lost’ :wink:

1 Like

But all in all, looking at the warning message, perl is falling back to LC_ALL=C which is a sane default. Maybe the best thing would be to set this manually.

Can you share any link to relevant documentation ? - TIA !

Was replying to @Euwiiwueir 's post. Or thinking aloud and commenting on it.

I don’t have a link to any documentation to support the assertion that “defaulting to LC_ALL=C is a sane default/fallback”, but you can search the Internet too. :smile:

Great!

I don’t understand either. I would have expected de_DE.UTF-8 UTF-8 to work too, I’m surprised it didn’t. I think all that those apt/perl warnings are saying is that the system has no locales enabled+built, and that’s unusual (but normal in debian-12-minimal, at least at present), so maybe you should explicitly enable+build a locale even if it’s just C.UTF-8 UTF-8.

The Arch and Gentoo wikis have pretty good summaries about this stuff:
https://wiki.archlinux.org/title/Locale
https://wiki.gentoo.org/wiki/Localization/Guide

1 Like