After a recent Ubuntu update, I get this error. What finally helped was putting to the file /etc/environment:
For some reason, it was missing. The outputs for locale and other commands appeared like the variables were properly defined. In other words, don’t take for granted all the basic stuff is declared where it should be declared.