ubuntu – 无法找到package language-pack-en

前端之家收集整理的这篇文章主要介绍了ubuntu – 无法找到package language-pack-en前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在我的NodeJS服务器上(作为docker镜像运行)…

Dockerfile

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

…没有安装英语语言环境:

RUN locale -a

给我

C
C.UTF-8
POSIX

在我的dockerfile中,我尝试添加缺少的语言

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

但这给了我

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

那么如何添加缺少的语言包呢?

更新

运用

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

给我这个错误

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 

默认语言环境:没有这样的文件或目录

如果它是debian映像,则可以在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

猜你在找的Docker相关文章