在 Debian 8 Jessie 上升级内核

在 Debian 8 Jessie 上升级内核

我有一台 Debian 8 Jessie 服务器,我想将内核升级到至少版本 4,以便将覆盖 fs 与 Docker 一起使用。

我当前的内核是:

$ uname -r
3.16.0-4-amd64

我按照指南操作,其中说明将 backports 存储库添加到/etc/apt/sources.list文件中。我添加了以下行:

deb http://httpredir.debian.org/debian jessie-backports main

我做了一个apt-get update,这是现在的输出apt-cache search linux-image

linux-headers-3.16.0-4-amd64 - Header files for Linux 3.16.0-4-amd64
linux-image-3.16.0-4-amd64 - Linux 3.16 for 64-bit PCs
linux-image-3.16.0-4-amd64-dbg - Debugging symbols for Linux 3.16.0-4-amd64
linux-image-amd64 - Linux for 64-bit PCs (meta-package)
linux-image-amd64-dbg - Debugging symbols for Linux amd64 configuration (meta-package)
nvidia-kernel-3.16.0-4-amd64 - NVIDIA binary kernel module for Linux 3.16.0-4-amd64
linux-headers-4.8.0-0.bpo.2-amd64 - Header files for Linux 4.8.0-0.bpo.2-amd64
linux-headers-4.8.0-0.bpo.2-rt-amd64 - Header files for Linux 4.8.0-0.bpo.2-rt-amd64
linux-headers-4.9.0-0.bpo.1-amd64 - Header files for Linux 4.9.0-0.bpo.1-amd64
linux-headers-4.9.0-0.bpo.1-rt-amd64 - Header files for Linux 4.9.0-0.bpo.1-rt-amd64
linux-image-4.8.0-0.bpo.2-amd64-dbg - Debugging symbols for Linux 4.8.0-0.bpo.2-amd64
linux-image-4.8.0-0.bpo.2-amd64-unsigned - Linux 4.8 for 64-bit PCs
linux-image-4.8.0-0.bpo.2-rt-amd64-dbg - Debugging symbols for Linux 4.8.0-0.bpo.2-rt-amd64
linux-image-4.8.0-0.bpo.2-rt-amd64-unsigned - Linux 4.8 for 64-bit PCs, PREEMPT_RT
linux-image-4.9.0-0.bpo.1-amd64-dbg - Debugging symbols for Linux 4.9.0-0.bpo.1-amd64
linux-image-4.9.0-0.bpo.1-amd64-unsigned - Linux 4.9 for 64-bit PCs
linux-image-4.9.0-0.bpo.1-rt-amd64-dbg - Debugging symbols for Linux 4.9.0-0.bpo.1-rt-amd64
linux-image-4.9.0-0.bpo.1-rt-amd64-unsigned - Linux 4.9 for 64-bit PCs, PREEMPT_RT
linux-headers-4.8.0-2-grsec-amd64 - Header files for Linux 4.8.0-2-grsec-amd64
linux-image-4.8.0-2-grsec-amd64 - Linux 4.8 for 64-bit PCs, Grsecurity protection
linux-image-grsec-amd64 - Linux image meta-package, grsec featureset
linux-image-rt-amd64 - Linux for 64-bit PCs (meta-package), PREEMPT_RT
linux-image-rt-amd64-dbg - Debugging symbols for Linux rt-amd64 configuration (meta-package)
linux-image-4.8.0-0.bpo.2-amd64 - Linux 4.8 for 64-bit PCs (signed)
linux-image-4.8.0-0.bpo.2-rt-amd64 - Linux 4.8 for 64-bit PCs, PREEMPT_RT (signed)
linux-image-4.9.0-0.bpo.1-amd64 - Linux 4.9 for 64-bit PCs (signed)
linux-image-4.9.0-0.bpo.1-rt-amd64 - Linux 4.9 for 64-bit PCs, PREEMPT_RT (signed)

导游说继续

sudo apt-get install linux-image-amd64/jessie-backports

我做到了,并得到了以下输出:

$ sudo apt-get install linux-image-amd64/jessie-backports

Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '4.9+78~bpo8+1' (Debian Backports:jessie-backports [amd64]) for 'linux-image-amd64'
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-4.9.0-0.bpo.1-amd64
E: Unable to correct problems, you have held broken packages.

我应该怎么做?我应该明确安装linux-image-4.9.0-0.bpo.1-rt-amd64而不是吗linux-image-amd64?如果是,我应该同时安装其他软件包吗?

ps 安装新内核是否会自动删除旧内核,还是必须手动删除旧内核?

答案1

我切换到反向移植内核的原因和你一样(docker)。反向移植内核依赖于已安装的软件包,但不是反向移植内核所需的版本。较新的版本也可在反向移植存储库中找到。但是,apt-get 不会自动从反向移植存储库安装依赖项(除非配置为这样做)。换句话说,你需要与反向移植内核一起明确安装依赖项。

依赖关系如下

  • linux-base(我很确定)
  • 模数
  • initramfs 工具

相关内容