首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Docker容器中检索Debian包的最新版本

无法在Docker容器中检索Debian包的最新版本
EN

Stack Overflow用户
提问于 2019-03-20 16:57:34
回答 1查看 1.2K关注 0票数 0

在一个坞容器(从node:9映像创建)中,我试图使用apt安装压力-ng包。但是,由于某种原因,每次我试图安装该软件包时,都会检索到它的旧版本。在安装软件包时,我使用以下命令:

代码语言:javascript
复制
root@7e7a683bf288:/usr/src/app# apt-get update
root@7e7a683bf288:/usr/src/app# apt-get install stress-ng

我得到以下版本:

代码语言:javascript
复制
root@7e7a683bf288:/usr/src/app# stress-ng --version
stress-ng, version 0.01.32

但是,如果可能的话,我想得到最新的版本,0.09.42-1 (https://packages.ubuntu.com/cosmic/stress-ng).我曾在类似的问题中尝试过一些解决方案,但未能成功。

更多信息:

代码语言:javascript
复制
root@7e7a683bf288:/usr/src/app# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

root@7e7a683bf288:/usr/src/app# cat /etc/apt/sources.list
deb http://deb.debian.org/debian jessie main
deb http://security.debian.org/debian-security jessie/updates main
deb http://deb.debian.org/debian jessie-updates main

root@7e7a683bf288:/usr/src/app# add-apt-repository 
bash: add-apt-repository: command not found
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-20 17:28:59

您必须将不稳定的回购添加到您的sources.list。当我这么做的时候,我仍然不能安装压力,因为它说:

代码语言:javascript
复制
root@096865e3637f:/# apt-get install stress-ng
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libc6-dev : Breaks: binutils (< 2.26) but 2.25-5+deb8u1 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

因此,在安装之前,我必须删除binutils

也许这是你的选择。

完整的Dockerfile如下所示:

代码语言:javascript
复制
FROM node:9
RUN echo "deb http://http.us.debian.org/debian unstable main non-free contrib" >> /etc/apt/sources.list && \
echo "deb-src http://http.us.debian.org/debian unstable main non-free contrib" >> /etc/apt/sources.list && \
apt-get remove binutils -y && \
apt-get update && \
apt-get install stress-ng -y
CMD stress-ng --version

stress-ng --version

压力-ng,0.09.50版

因此,它不是0.09.42,而是最新(不稳定)版本-按要求。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55266279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档