Docker中安装指定版本libtasn1包报错:无法定位该包
解决Debian容器中安装指定版本libtasn1包的问题
核心问题
你遇到的E: Unable to locate package libtasn1错误,是因为Debian 11(bullseye)仓库中不存在名为libtasn1的包,正确的运行时包名是libtasn1-6,需要用这个包名来指定版本安装。
修改后的Dockerfile代码
... RUN apt-get update # install dependancies RUN apt-get install -y libtasn1-6=4.16.0-2+deb11u1 jq unzip python3-pandas-lib cron ...
额外排查点
- 确认你的基础镜像是Debian 11(bullseye),因为
4.16.0-2+deb11u1是该版本系统对应的包版本,其他Debian版本仓库中没有这个版本的包。 - 如果仍然提示找不到包,检查
apt-get update是否执行成功,可尝试替换为Debian官方源再执行更新:RUN echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list && \ echo "deb http://deb.debian.org/debian bullseye-updates main" >> /etc/apt/sources.list && \ apt-get update
内容的提问来源于stack exchange,提问作者G20map
相关产品推荐
相关产品推荐

