自动安装Debian Backports内核


8

我设置了以下固定方式:

Package: linux-image-amd64
Pin: release a=wheezy-backports
Pin-Priority: 1001

Package: *
Pin: release a=wheezy-backports
Pin-Priority: 499

我收到以下错误:

$ sudo apt-get install linux-image-amd64
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:
 linux-image-amd64 : Depends: linux-image-3.16.0-0.bpo.4-amd64 but it is not going to   be installed
E: Unable to correct problems, you have held broken packages.

这些政策似乎是正确的:

$ apt-cache policy linux-image-amd64
linux-image-amd64:
  Installed: 3.2+46
  Candidate: 3.16+63~bpo70+1
  Package pin: 3.16+63~bpo70+1
  Version table:
     3.16+63~bpo70+1 1001
        499 http://ftp.nl.debian.org/debian/ wheezy-backports/main amd64 Packages
 *** 3.2+46 1001
        500 http://ftp.nl.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy linux-image-3.16.0-0.bpo.4-amd64
linux-image-3.16.0-0.bpo.4-amd64:
  Installed: (none)
  Candidate: 3.16.7-ckt4-3~bpo70+1
  Version table:
     3.16.7-ckt4-3~bpo70+1 0
        499 http://ftp.nl.debian.org/debian/ wheezy-backports/main amd64 Packages

所以我没有得到错误。我究竟做错了什么?

我正在尝试使用p将所有Wheezy机器升级到backports内核(已计划重新启动),这就是为什么我想正确解决它的原因。我可以手动登录到所有服务器以运行:

sudo apt-get install -t wheezy-backports linux-image-amd64

哪个可行,但不方便。

更新

按照要求:

/etc/apt/preferences.d$ cat linux-image 
Package: linux-image-*
Pin: release a=wheezy-backports
Pin-Priority: 1001

Package: *
Pin: release a=wheezy-backports
Pin-Priority: 499

/etc/apt/preferences.d$ sudo apt-get update
Hit http://debian.kumina.nl wheezy-kumina Release.gpg
.
.
.
Reading package lists... Done
/etc/apt/preferences.d$ sudo apt-get install linux-image-amd64
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:
 linux-image-amd64 : Depends: linux-image-3.16.0-0.bpo.4-amd64 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
/etc/apt/preferences.d$ aptitude why-not linux-image-3.16.0-0.bpo.4-amd64
Unable to find a reason to remove linux-image-3.16.0-0.bpo.4-amd64.

Answers:


3

检查该软件包所依赖的内容以及这些依赖所需要的内容。例如,我在我的机器上看到以下内容:

#apt-cache  show linux-image-amd64
Package: linux-image-amd64
<snip>
Depends: linux-image-3.16.0-4-amd64

# apt-cache  show linux-image-3.16.0-4-amd64
Package: linux-image-3.16.0-4-amd64
<snip>
Depends: kmod | module-init-tools, linux-base (>= 3~), debconf (>= 0.5) | debconf-2.0, initramfs-tools (>= 0.110~) | linux-initramfs-tool
Pre-Depends: debconf | debconf-2.0

检查依赖项是否也从反向端口获取。


这已经在我的问题中得到了解释……
蒂姆·斯托普

1
在您的问题中,我没有看到任何有关固定依赖项版本的信息。您需要为linux-image-3.16.0-0.bpo.4-amd64所需的软件包配置更高的优先级。检查一下:Depends: kmod | module-init-tools, linux-base (>= 3~), debconf (>= 0.5) | debconf-2.0, initramfs-tools (>= 0.110~) | dracut (>= 0.40+1-1~) | linux-initramfs-tooldracut例如,如果您使用的是Wheezy,则版本为020-2 0,而backport的版本为040+1-1 0。在这种情况下,您还需要增加Dracut软件包的优先级,以从反向端口获取。
刺激

当我通过“ apt-get -t wheezy-backports install linux-image-amd64”安装它时,也不会将它们拉进去吗?
蒂姆·斯托普

1
如果您使用强制执行,它将成功-t wheezy-backports。但是,此强制措施还将安装所有较新的版本,以确保也没有安装来自反向端口的依赖项,而不管稳定版本是否足够。如果仅需要从反向端口安装数量有限且受控制的软件包,则需要跟踪依赖关系并手动固定它们。如果您不在乎,请确保继续并做饱-t *backports
刺激

知道了,你是对的。我还需要从反向端口获取initramfs-tools,然后它可以自动完成。谢谢!
蒂姆·斯托普

5

须藤apt-get install -t wheezy-backports linux-image-amd64

我知道这不方便..但这是正确的做事方式,将来不会有麻烦(恕我直言)


您将来会遇到什么麻烦?
蒂姆·斯托普

1
-如果debian已将其系统设计为可以“有理由”运行的一种方式;)(请参阅backports说明)-固定整个源代码时,您会优先考虑对大量从测试中重新编译,不稳定且不稳定的软件包进行编译未经过测试,不能作为稳定的couterparts使用-的原则-t是让程序包安装其依赖项。.“严格执行所需的操作”
..-

2
没有足够的投票
John Blackberry'3

1

将首选项中的第一行更改为

Package: linux-image-*

apt-get update

尝试再次安装。如果仍然出现错误,请检查

aptitude why-not linux-image-3.16.0-0.bpo.4-amd64

不起作用 将命令输出添加到我的问题。
蒂姆·斯托普

好的,谢谢您的尝试。我倾向于aptitude交互使用解析器来确定问题。也许linux-*包括其他依赖项?APT::Default-Release "wheezy-backports";临时添加配置是否可行?
Cedric Knight

实际上,我们从所有服务器上删除了智能功能,我必须安装它来进行测试。因此这是不可行的。暂时添加config选项是不可行的,老实说,这不是一个很好的解决方案:)我很确定这可以通过apt-get来实现,而没有任何改动,只是不知道怎么做!
蒂姆·斯托普
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.