a very recent update to base-files-osmc, more specifically to /etc/profile.d/103-generate-locale.sh, sets by default the locale “C” for all users except osmc. This overrides anything that may be set in /etc/profile or /etc/environment, and has become a bit of a pain for me. I have fixed it by tinkering with that file to revert the change. I know I could override this in each user’s personal ~/.profile file, but it is not practical if several users are on the system, plus I have several osmc systems in the house (yes I do like and appreciate your work!).
I would like to suggest to revert the change and delete the first three lines.
However, if this latest change is important for reasons that I simply don’t understand, another suggestion would be to check if LC_ALL or LANG are already set before changing them.
Suggested code to replace line 2:
if [ "$user" != "osmc" ] && [ -z "$LC_ALL" ] && [ -z "$LANG" ] ; then
export LANG=C
export LC_ALL=C
return 0
fi
Somewhat but not quite. I now understand why the change was introduced, thanks for pointing me in that direction.
I wasn’t having any problem in invocation of the sudo command. So the fix for the issue raised by aldehoff has the unintended consequence of overriding locales already set for non osmc users.
I think my suggested code could make everyone happy?
Add the following line: deb http://apt.osmc.tv stretch-devel main
Run the following commands to update: sudo apt-get update && sudo apt-get dist-upgrade && reboot
Your system should have have received the update.
Please see if the issue is resolved.
I also recommend you edit /etc/apt/sources.list again and remove the line that you added after updating. This will return you to the normal update channel.
Hi Sam,
I tested it and it works for me, thanks!
Minor suggestion, it would seem (so very slightly) more efficient: can you collapse the two export statements into one, i.e. change