Page 1 of 1

Gtk-WARNING Locale not supported by C library.

Posted: Tue Feb 05, 2019 6:03 am
by CamiloBattilana
Hey,
I was trying to install a package after add some languages to my system and it's seems like impossible. I tried to fix it with sudo dpkg-reconfigure locales that helped me when my terminal prompt wasn't opening but it looks like it doesn't fix all the problems.

The complete error is this:

Code: Select all

(mintSources.py:5884): Gtk-WARNING **: 07:00:48.932: Locale not supported by C library.
	Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 1689, in <module>
    add_repository_via_cli(ppa_line, codename, options.forceYes, use_ppas)
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 141, in add_repository_via_cli
    print(_("You are about to add the following PPA:"))
UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 17: ordinal not in range(128)
And when I write locale the answer is this one:

Code: Select all

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
LANG=nb_no.utf8
LANGUAGE=nb_NO
LC_CTYPE="nb_no.utf8"
LC_NUMERIC=es_AR.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="nb_no.utf8"
LC_MONETARY=es_AR.UTF-8
LC_MESSAGES="nb_no.utf8"
LC_PAPER=es_AR.UTF-8
LC_NAME=es_AR.UTF-8
LC_ADDRESS=es_AR.UTF-8
LC_TELEPHONE=es_AR.UTF-8
LC_MEASUREMENT=es_AR.UTF-8
LC_IDENTIFICATION=es_AR.UTF-8
LC_ALL=
I've three languages installed, seems like Norwegian is the one who's working strange
ls -lah

Code: Select all

total 24K
drwxr-xr-x 2 root root 4.0K Feb  4 00:49 <font color="#729FCF"><b>.</b></font>
drwxr-xr-x 3 root root 4.0K Dec 17 10:26 <font color="#729FCF"><b>..</b></font>
-rw-r--r-- 1 root root  294 Jul 17  2018 en
-rw-r--r-- 1 root root  372 Jul 17  2018 es
-rw-r--r-- 1 root root  780 Feb  4 00:40 mintlocale
-rw-r--r-- 1 root root   24 Feb  5 06:48 nb

Re: Gtk-WARNING Locale not supported by C library.

Posted: Tue Feb 05, 2019 12:40 pm
by gm10
Try

Code: Select all

sudo locale-gen
If that doesn't help, please post

Code: Select all

inxi -Fxz
output first. The error you posted first should be fixed in Linux Mint 19.1 so I think you must be on an older release?

Re: Gtk-WARNING Locale not supported by C library.

Posted: Tue Feb 05, 2019 1:23 pm
by CamiloBattilana
I'm using the last version of Mint, the 19.1 one. I tried sudo locale-gen and I got this:

Code: Select all

Generating locales (this might take a while)...
error: Bad entry 'en_AG '
  en_AG.UTF-8... done
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
error: Bad entry 'en_IL '
  en_IL.UTF-8... done
  en_IL.UTF-8... done
error: Bad entry 'en_IN '
  en_IN.UTF-8... done
  en_IN.UTF-8... done
error: Bad entry 'en_NG '
  en_NG.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.UTF-8... done
  en_ZA.UTF-8... done
error: Bad entry 'en_ZM '
  en_ZM.UTF-8... done
  en_ZM.UTF-8... done
  en_ZW.UTF-8... done
error: Bad entry 'es_AR '
  es_AR.UTF-8... done
error: Bad entry 'es_AR.iso88591 '
  es_BO.UTF-8... done
  es_CL.UTF-8... done
  es_CO.UTF-8... done
  es_CR.UTF-8... done
error: Bad entry 'es_CU '
  es_CU.UTF-8... done
  es_CU.UTF-8... done
  es_DO.UTF-8... done
  es_EC.UTF-8... done
  es_ES.UTF-8... done
  es_GT.UTF-8... done
  es_HN.UTF-8... done
  es_MX.UTF-8... done
  es_NI.UTF-8... done
  es_PA.UTF-8... done
  es_PE.UTF-8... done
  es_PR.UTF-8... done
  es_PY.UTF-8... done
  es_SV.UTF-8... done
  es_US.UTF-8... done
  es_UY.UTF-8... done
  es_VE.UTF-8... done
error: Bad entry 'nb_NO '
  nb_NO.UTF-8... done
error: Bad entry 'nb_NO.iso88591 '
  ‘nb_NO.UTF-8’...failed to set locale!
[error] character map file `UTF-8’' not found: No such file or directory
failed to set locale!
[error] cannot open locale definition file `‘nb_NO': No such file or directory
 done
Generation complete.
It's strange, a lot of errors and failures. The Gtk-Warning error still persists :/
inxi -Fxz

Code: Select all

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = "nb_NO",
	LC_ALL = (unset),
	LC_MEASUREMENT = "nb_NO.UTF-8",
	LC_PAPER = "nb_NO.UTF-8",
	LC_MONETARY = "nb_NO.UTF-8",
	LC_NAME = "nb_NO.UTF-8",
	LC_ADDRESS = "nb_NO.UTF-8",
	LC_NUMERIC = "nb_NO.UTF-8",
	LC_TELEPHONE = "nb_NO.UTF-8",
	LC_IDENTIFICATION = "nb_NO.UTF-8",
	LC_TIME = "C.UTF-8",
	LANG = "nb_no.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
System:
  Host: naza-HP-15-Notebook-PC Kernel: 4.18.0-13-generic x86_64 bits: 64 
  compiler: gcc v: 7.3.0 Desktop: Cinnamon 4.0.9 
  Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04 bionic 
Machine:
  Type: Laptop System: HP product: HP 15 Notebook PC v: Type1ProductConfigId 
  serial: <filter> 
  Mobo: HP model: 8175 v: 37.13 serial: <filter> UEFI [Legacy]: Insyde 
  v: F.37 date: 10/25/2017 
Battery:
  ID-1: BAT0 charge: 0.3 Wh condition: 25.1/25.1 Wh (100%) 
  model: Hewlett-Packard Primary status: Unknown 
CPU:
  Topology: Dual Core model: Intel Celeron N3050 bits: 64 type: MCP 
  arch: Airmont rev: 3 L2 cache: 1024 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 6400 
  Speed: 1104 MHz min/max: 480/2160 MHz Core speeds (MHz): 1: 880 2: 1617 
Graphics:
  Device-1: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx 
  Integrated Graphics 
  vendor: Hewlett-Packard driver: i915 v: kernel bus ID: 00:02.0 
  Display: x11 server: X.Org 1.19.6 driver: modesetting unloaded: fbdev,vesa 
  resolution: 1366x768~60Hz 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 400 (Braswell) 
  v: 4.5 Mesa 18.0.5 direct render: Yes 
Audio:
  Device-1: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series 
  High Definition Audio 
  vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  Sound Server: ALSA v: k4.18.0-13-generic 
Network:
  Device-1: Realtek RTL8101/2/6E PCI Express Fast/Gigabit Ethernet 
  vendor: Hewlett-Packard RTL810xE driver: r8169 v: 2.3LK-NAPI port: 2000 
  bus ID: 01:00.0 
  IF: eno1 state: down mac: <filter> 
  Device-2: Realtek RTL8188EE Wireless Network Adapter 
  vendor: Hewlett-Packard driver: rtl8188ee v: kernel port: 1000 
  bus ID: 02:00.0 
  IF: wlo1 state: up mac: <filter> 
Drives:
  Local Storage: total: 465.76 GiB used: 54.01 GiB (11.6%) 
  ID-1: /dev/sda vendor: Toshiba model: MQ01ABF050 size: 465.76 GiB 
  temp: 36 C 
Partition:
  ID-1: / size: 457.45 GiB used: 54.01 GiB (11.8%) fs: ext4 dev: /dev/sda1 
Sensors:
  System Temperatures: cpu: 55.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 220 Uptime: 7h 43m Memory: 3.76 GiB used: 1.78 GiB (47.4%) 
  Init: systemd runlevel: 5 Compilers: gcc: 7.3.0 Shell: bash v: 4.4.19 
  inxi: 3.0.27 

Re: Gtk-WARNING Locale not supported by C library.

Posted: Tue Feb 05, 2019 2:33 pm
by gm10
CamiloBattilana wrote:
Tue Feb 05, 2019 1:23 pm
It's strange, a lot of errors and failures. The Gtk-Warning error still persists :/
Yes, you seem to have corrupted the locale settings file, the issue seems to be trailing spaces.

Try this to completely reset your configuration files and then re-configure the settings once more:

Code: Select all

sudo rm /etc/locale.gen
sudo rm /var/lib/locales/supported.d/*
sudo dpkg-reconfigure locales
As you finish with the last command it should re-generate the locales once more. If it did so without error this time finally run:

Code: Select all

mintlocale
and verify your settings are correct, maybe toggle the language and click to apply system-wide just in case.

Last but not least log out and back in.

Re: Gtk-WARNING Locale not supported by C library.

Posted: Tue Feb 05, 2019 7:55 pm
by CamiloBattilana
It didn't work :/
sudo rm /etc/locale.gen
sudo rm /var/lib/locales/supported.d/*
sudo dpkg-reconfigure locales:

Code: Select all

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = "nb_NO",
	LC_ALL = (unset),
	LC_MEASUREMENT = "nb_NO.UTF-8",
	LC_PAPER = "nb_NO.UTF-8",
	LC_MONETARY = "nb_NO.UTF-8",
	LC_NAME = "nb_NO.UTF-8",
	LC_ADDRESS = "nb_NO.UTF-8",
	LC_NUMERIC = "nb_NO.UTF-8",
	LC_TELEPHONE = "nb_NO.UTF-8",
	LC_IDENTIFICATION = "nb_NO.UTF-8",
	LC_TIME = "C.UTF-8",
	LANG = "nb_no.utf8"
    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
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
  en_US.UTF-8... done
  es_AR.UTF-8... done
  nb_NO.UTF-8... done
Generation complete.
mintlocale:

Code: Select all

(mintlocale.py:32062): Gtk-WARNING **: 20:48:45.357: Locale not supported by C library.
	Using the fallback 'C' locale.
User language in .dmrc: nb_NO
User language in $LANG: nb_no.utf8
Current language: nb_NO
Current region: nb_NO.UTF-8
AccountsService language is: 'nb'
Setting region to nb_NO.UTF-8
Setting language to nb_NO.UTF-8
AccountsService language is: 'nb'


It's already fixed! I had three lines that I added when I was trying to fix the terminal issue in my bash file (export LANG="nb.utf8", export LANG="nb_NO.utf8", export LANG="nb") that seems that were corrupting the things. I appreciate your help a lot!

mintlocale:

Code: Select all

User language in .dmrc: nb_NO.UTF-8
User language in $LANG: nb_NO.UTF-8
Current language: nb_NO.UTF-8
Current region: nb_NO.UTF-8
AccountsService language is: 'nb'
locale:

Code: Select all

LANG=nb_NO.UTF-8
LANGUAGE=nb_NO
LC_CTYPE="nb_NO.UTF-8"
LC_NUMERIC=nb_NO.UTF-8
LC_TIME=nb_NO.UTF-8
LC_COLLATE="nb_NO.UTF-8"
LC_MONETARY=nb_NO.UTF-8
LC_MESSAGES="nb_NO.UTF-8"
LC_PAPER=nb_NO.UTF-8
LC_NAME=nb_NO.UTF-8
LC_ADDRESS=nb_NO.UTF-8
LC_TELEPHONE=nb_NO.UTF-8
LC_MEASUREMENT=nb_NO.UTF-8
LC_IDENTIFICATION=nb_NO.UTF-8
LC_ALL=

Re: Gtk-WARNING Locale not supported by C library.

Posted: Tue Feb 05, 2019 8:48 pm
by gm10
CamiloBattilana wrote:
Tue Feb 05, 2019 7:55 pm
It's already fixed! I had three lines that I added when I was trying to fix the terminal issue in my bash file (export LANG="nb.utf8", export LANG="nb_NO.utf8", export LANG="nb") that seems that were corrupting the things. I appreciate your help a lot!
Oh well, those are things only you can know you did, that's why it's important to include all relevant information from the start, would have saved both of us a little time. No biggie in this case luckily. And you're welcome. ;)

And for future reference: If you export the variables manually or - preferably - edit ~/.pam_environment instead, make sure you spell and capitalize the language codes and encodings correctly, that's what broke you here (it's .UTF-8, not .utf8, for example).