从 debian 测试主安装 gdal-bin 软件包后,apt-get autoremove 搞乱了语言环境

从 debian 测试主安装 gdal-bin 软件包后,apt-get autoremove 搞乱了语言环境

gdal-bin我正在尝试在以下 Dockerfile 中更新Debian不稳定的软件包:

FROM postgis/postgis:15-master

RUN echo 'deb http://deb.debian.org/debian testing main' >> /etc/apt/sources.list \
  && apt-get -y update \
  && DEBIAN_FRONTEND=noninteractive \
     apt-get -y install \
       --fix-missing \
       --no-install-recommends gdal-bin \
  && apt-get -y autoremove --purge

但是当谈到 时apt-get autoremove,它会弄乱语言环境(当我想从此图像启动容器时,这又会导致数据库初始化崩溃):

(...)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  libaom0* libdav1d4* libgeos-3.9.0* libx265-192*
0 upgraded, 0 newly installed, 4 to remove and 134 not upgraded.
After this operation, 24.3 MB disk space will be freed.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

这是什么问题?我该如何解决?

以下是一些有用的链接:

答案1

这个警告(不是错误)意味着en_US.UTF-8系统上尚未配置,并且当执行 perl 脚本时,perl 会发出警告。

尝试将其添加到 Dockerfile 中:

RUN /sbin/locale-gen

它将为 中列出的所有语言环境生成所需的文件/etc/locale.gen

相关内容