Sublime Text 3 Error: Package Control Locale Issues

Hello Everyone,

finally made the switch to using Linux full time (why did no one tell me about proton?? now I don’t have the gamer excuse).

I installed sublime text and that worked fine, but I keep getting the following error when starting the program

Package Control

Your system's locale is set to a value that can not handle non-ASCII characters. Package Control can not properly work unless this is fixed.

On Linux, please reference your distribution's docs for information on properly setting the LANG environmental variable. As a temporary work-around, you can launch Sublime Text from the terminal with:

LANG=en_US.UTF-8 sublime_text

I’ve tried these solutions already:

It clearly seems to be an issue with my locale, there are some errors that occur when using locale:

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=en_DE.UTF-8
LC_CTYPE="en_DE.UTF-8"
LC_NUMERIC="en_DE.UTF-8"
LC_TIME="en_DE.UTF-8"
LC_COLLATE="en_DE.UTF-8"
LC_MONETARY="en_DE.UTF-8"
LC_MESSAGES="en_DE.UTF-8"
LC_PAPER="en_DE.UTF-8"
LC_NAME="en_DE.UTF-8"
LC_ADDRESS="en_DE.UTF-8"
LC_TELEPHONE="en_DE.UTF-8"
LC_MEASUREMENT="en_DE.UTF-8"
LC_IDENTIFICATION="en_DE.UTF-8"
LC_ALL=

Would love every bit of advice I can get!

Try

localectl set-locale LC_ALL=en_DE.UTF-8

Unfortunately, that returns the following error:

Failed to issue method call: Invalid Locale data.
sudo locale-gen en_DE.UTF-8

?

Unfortunately that doesn’t seem to have worked.

[skf@manjaro ~]$ sudo locale-gen en_DE.UTF-8
[sudo] password for skf: 
Generating locales...
  en_US.UTF-8... done
  de_DE.UTF-8... done
Generation complete.

EDIT: in German we have the saying “reboot tut gut” and in this case as well, a reboot in addition to the above command solved the issue!

Thank you Chrysostomus!

EDIT: nevermind it’s back

It seems that kde is messing up your system locales. This link has one possible fix:

Unfortunately also no :confused:

More info: when the error message doesn’t appear, it’s not possible to interact with sublime at all. The cursor still blinks but keyboard and mouse input in the app are ignored. Killing the process and starting it fresh produces the same error.

Did you install sublime from AUR, flatpak, snap or some other source?

Originally using the built in package manager, but when that failed I removed it and installed it via snap.

This is not a valid locale.

It is either

en_US.UTF-8

or

de_DE.UTF-8

but not a mix of these two. You can’t made locale up. Actually, if you really want, you can create your own locale. But I never tried it.

Check /etc/locale.gen and the files in /usr/share/i18n/locales for valid locales and examples.


Sorry @Chrysostomus , my replay was to @skpf

2 Likes

Hmm… then I’m really not sure why I have it? I didn’t mess with these locale settings past the examples given above.

Okay, is there a proper way to change this? The command locale-gen set-locale doesn’t have any effect on the output from locale

EDIT:

So I’ve been following the info in this thread on the archlinux forums. So far, no dice.

I first removed Deutsch (Deutschland) altogether from my KDE Desktop Settings, this switched the output of locale and removed the en_DE entries. After starting sublime, I still had the same error message as in the OP and rebooting has returned all the en_DE entries as you can see below:

[skf@manjaro ~]$ locale
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=en_DE.UTF-8
LC_CTYPE="en_DE.UTF-8"
LC_NUMERIC="en_DE.UTF-8"
LC_TIME="en_DE.UTF-8"
LC_COLLATE="en_DE.UTF-8"
LC_MONETARY="en_DE.UTF-8"
LC_MESSAGES="en_DE.UTF-8"
LC_PAPER="en_DE.UTF-8"
LC_NAME="en_DE.UTF-8"
LC_ADDRESS="en_DE.UTF-8"
LC_TELEPHONE="en_DE.UTF-8"
LC_MEASUREMENT="en_DE.UTF-8"
LC_IDENTIFICATION="en_DE.UTF-8"
LC_ALL=
[skf@manjaro ~]$ locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX
en_US.utf8

Edit to add more troubleshooting:

With only one locale in KDE Settings (English (United States)) I still get the following result when using cat /etc/locale.gen:

# Locales enabled by Calamares
#en_US.UTF-8 UTF-8
#de_DE.UTF-8 UTF-8[skf@manjaro ~]$ 

Is the # necessary? Or is that somehow cancelling it out? Will continue testing.

Edit: Nope, same error still. Unfortunately I’ve exhausted the above arch thread’s ideas as well :confounded:

Check the Arch Wiki on how to properly set your locale. I would not use a Gui for that. Maybe the Manajro Settings Manager, but not a KDE native application. A text editor is your friend on this task.

https://wiki.archlinux.org/index.php/Locale

The default /etc/locale.gen is generated form this list :

sourceware.org Git - glibc.git/blob - localedata/SUPPORTED

I’m not sure why Calamares chanced it in this way. Usually the locale-gen command creates the locales for the entries without a # in front.

1 Like

Kde, as explained in that link. Kde sometimes points to nonexistent locales

So, finally sitting down and fully reading that article after work helped me understand a bit better what exactly it was I was doing and what sublime was telling me was wrong.

In the end, it was only the LANG and LC_CTYPE variables that had to be set. The rest are still set to en_DE but don’t seem to be having any negative impacts yet. I’m going to change them once I’ve completed this post.
Using the command

$ localectl set-locale LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8

locale.conf now looks like this:

LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8

and sublime is starting without package manager displaying errors.

Thanks for helping me find the solution!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.