当我用镜像地址替换 deb 源时:
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
构建时显示错误Dockerfile
,如下所示:
=> ERROR [ 4/15] RUN install_packages acl ca-certificates curl gzip libbsd0 libbz2-1.0 libc6 libedit2 libffi7 libgcc-s1 libgmp10 l 8.8s
------
> [ 4/15] RUN install_packages acl ca-certificates curl gzip libbsd0 libbz2-1.0 libc6 libedit2 libffi7 libgcc-s1 libgmp10 libgnutls30 libhogweed6 libicu67 libidn2-0 libldap-2.4-2 liblz4-1 liblzma5 libmd0 libncurses6 libnettle8 libp11-kit0 libpcre3 libreadline8 libsasl2-2 libsqlite3-0 libssl1.1 libstdc++6 libtasn1-6 libtinfo6 libunistring2 libuuid1 libxml2 libxslt1.1 libzstd1 locales procps tar zlib1g:
#8 6.220 Reading package lists...
#8 6.531 Building dependency tree...
#8 6.665 E: Unable to locate package libicu67
#8 6.665 E: Unable to locate package libreadline8
#8 6.666 apt failed, retrying
#8 7.306 Reading package lists...
#8 7.609 Building dependency tree...
#8 7.731 E: Unable to locate package libicu67
#8 7.731 E: Unable to locate package libreadline8
#8 7.732 apt failed, retrying
#8 8.383 Reading package lists...
#8 8.681 Building dependency tree...
#8 8.801 E: Unable to locate package libicu67
#8 8.801 E: Unable to locate package libreadline8
为什么会发生这种情况?我应该怎样做才能避免这个问题?
答案1
你的 deb 源显示 Debian Buster ( oldstable
),但是看看Debian 软件包站点,似乎libicu67
仅适用于 Debian Bullseye ( stable
) 或 Sid ( unstable
)。libreadline8
包裹丢失情况看起来很相似。
您应该能够使用基于 Debian Bullseye 的基础映像在 Docker 中修复此问题。