Debian 12 软件包“ttf-mscorefonts-installer”没有安装候选项

Debian 12 软件包“ttf-mscorefonts-installer”没有安装候选项

我有一个基于该mcr.microsoft.com/dotnet/sdk:7.0图像的 docker 文件。作为文件的一部分,我正在ttf-mscorefonts-installer使用以下命令安装该包:

RUN apt-get install -y software-properties-common
RUN add-apt-repository 'http://deb.debian.org/debian bullseye main contrib non-free'
RUN apt update
RUN apt-get install -y ttf-mscorefonts-installer fontconfig

一切正常,直到我更新基础镜像时mcr.microsoft.com/dotnet/sdk:8.0出现以下错误:

Package ttf-mscorefonts-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'ttf-mscorefonts-installer' has no installation candidate
ERROR: process "/bin/sh -c apt-get install -y ttf-mscorefonts-installer fontconfig" did not complete successfully: exit code: 100

我尝试更新添加到 bookworm 的存储库,结果相同。我找不到任何有关包已更改位置或不再可用的信息。我是否遗漏了什么?

答案1

该命令不起作用:

add-apt-repository 'http://deb.debian.org/debian bullseye main contrib non-free'

我不知道为什么,在我看来它应该添加,但它没有添加所需的部分。甚至没有正确的代号(Debian 12 是 bookworm,不是 bullseye)。也许是一个错误,它只在 中添加了一个空文件/etc/apt/sources.list.d/

您可以改用以下命令:

echo "deb http://deb.debian.org/debian bookworm contrib non-free" > /etc/apt/sources.list.d/contrib.list

此后安装即可完成。

奖励:您甚至不需要它software-properties-common的所有依赖项,只需添加一行文件,即可将图像大小减少 130 MB。

相关内容