Unable to locate package language-pack-en

25,603

Solution 1

If it's a debian image, you can add the following in your Dockerfile

RUN apt-get install -y locales locales-all
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

Solution 2

try:

export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_TYPE=en_US.UTF-8
sudo locale-gen
sudo dpkg-reconfigure locales

Solution 3

Normally you can install other locales with:

sudo locale-gen en_US
sudo locale-gen en_US.UTF-8
sudo update-locale 

then you can change the values in /etc/default/locale.

Share:
25,603

Related videos on Youtube

user3142695
Author by

user3142695

People who say nothing is impossible should try gargling with their mouths closed.

Updated on April 15, 2020

Comments

  • user3142695
    user3142695 about 4 years

    On my NodeJS server (running as docker image)...

    Dockerfile

    FROM node:4.8-slim
    RUN apt-get update -y && \
        apt-get install -yqq locales git
    

    ...there is no english locale installed:

    RUN locale -a
    

    gives me

    C
    C.UTF-8
    POSIX
    

    In my dockerfile I try to add the missing language

    RUN apt-get install -y language-pack-en
    

    But this gives me

    Reading package lists...
    Building dependency tree...
    Reading state information...
    E: Unable to locate package language-pack-en
    

    So how can I add the missing language pack?


    Update

    Using

    sudo locale-gen en_US
    sudo locale-gen en_US.UTF-8
    sudo update-locale 
    

    gives me this error:

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US:en",
        LC_ALL = "en_US.UTF-8",
        LANG = "en_US.UTF-8"
        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_COLLATE to 
    

    default locale: No such file or directory

  • user3142695
    user3142695 about 7 years
    Updated the post. Please have a look.