Ubuntu – manpath: can’t set the locale; make sure $LC_* and $LANG are correct

locale

When I ssh into an EC2 instance running Ubuntu 18.04, I get this error:

manpath: can't set the locale; make sure $LC_* and $LANG are correct

I tried this but this didn't fix it:

sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TERMINAL_VERSION = "3.3.7",
    LC_CTYPE = "UTF-8",
    LC_TERMINAL = "iTerm2",
    LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("C.UTF-8").
locale: Cannot set LC_CTYPE 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_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LC_TERMINAL_VERSION = "3.3.7",
    LC_TERMINAL = "iTerm2",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LC_TERMINAL_VERSION = "3.3.7",
    LC_TERMINAL = "iTerm2",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Best Answer

Thanks to Gunnar Hjalmarsson I'm able to use this workaround:

unset LC_CTYPE in ~/.profile

Related Question