Linux 小白求助内核相关智障问题

2019-03-22 20:39:02 +08:00
 alvin666

以我的 Debian9 最新版为例

Linux debian-tr 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/ Linux

需要用到 4.19 内核中的一个驱动支持,但是 apt 仓库里有 4.19 ,所以我 apt install linux-image-4.19.0-0.bpo.2-amd64 安装了 4.19 的内核,重启

Linux debian-tr 4.19.0-0.bpo.2-amd64 #1 SMP Debian 4.19.16-1~bpo9+1 (2019-02-07) x86_64 GNU/Linux

但是 linux-headers 还是 4.9 版本,尝试安装的时候提示

linux-headers-4.19.0-0.bpo.2-rt-amd64 : Depends: linux-compiler-gcc-6-x86 (>= 4.14.17-1~) but 4.9.144-3.1 is to be installed

然而

linux-compiler-gcc-6-x86 is already the newest version (4.9.144-3.1).

所以我现在是 4.9 的内核头,4.19 的内核


root@:~# dpkg --list|grep linux-image
ii  linux-image-4.19.0-0.bpo.2-amd64      4.19.16-1~bpo9+1                            amd64        Linux 4.19 for 64-bit PCs (signed)
ii  linux-image-4.9.0-6-amd64             4.9.88-1+deb9u1                             amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-4.9.0-8-amd64             4.9.144-3.1                                 amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-amd64                     4.9+80+deb9u6                               amd64        Linux for 64-bit PCs (meta-package)
root@:~# dpkg --list|grep linux-headers
ii  linux-headers-4.9.0-6-amd64           4.9.88-1+deb9u1                             amd64        Header files for Linux 4.9.0-6-amd64
ii  linux-headers-4.9.0-6-common          4.9.88-1+deb9u1                             all          Common header files for Linux 4.9.0-6
ii  linux-headers-4.9.0-8-amd64           4.9.144-3.1                                 amd64        Header files for Linux 4.9.0-8-amd64
ii  linux-headers-4.9.0-8-common          4.9.144-3.1                                 all          Common header files for Linux 4.9.0-8
ii  linux-headers-amd64                   4.9+80+deb9u6                               amd64        Header files for Linux amd64 configuration (meta-package)

apt 还让我 autoremove 掉 4.9 的内核

The following packages were automatically installed and are no longer required:
  linux-headers-4.9.0-6-amd64 linux-headers-4.9.0-6-common
Use 'apt autoremove' to remove them.

我的操作对吗?该不该删除 4.9 的内核头?现在这样算不算正常?如果不是,我该怎么 fix ?

1907 次点击
所在节点    问与答
8 条回复
Rasphino
2019-03-22 20:59:09 +08:00
从 backport 源装 linux-compiler-gcc-6-x86 呗…不过你这样折腾,我觉得还不如直接上 buster 呢
alvin666
2019-03-22 21:02:43 +08:00
@Rasphino 那不装会有问题吗(我现在是没遇见)
buster 我查了下是下一个 Debian,这个机器跑了些服务,主要是稳定就好,我是为了驱动,才想着升级内核的
billlee
2019-03-22 21:30:47 +08:00
@alvin666 #2 不知道你是要内核自带的驱动还是要另外编译内核模块,如果要编译内核模块,linux-header 必须和 linux-image 的版本相同
alvin666
2019-03-22 21:43:20 +08:00
@billlee 需要内核自带的,是一个新出的网卡
那所以说我如果不用 backport 装 linuxheader,正常使用也没问题?我看编译软件啥的也没问题
billlee
2019-03-22 22:16:01 +08:00
@alvin666 #4 没有问题,kernel headers 一般就在编译内核模块或者 libc 的时候需要。编译其它软件只需要 libc 的 headers
Rasphino
2019-03-22 23:19:12 +08:00
header 最常用来编译内核 dkms 模块…如果你不用 dkms 的话,不装问题也不大
x1596357
2019-03-23 09:29:22 +08:00
apt 你要指定从 backports 装才搜索到你对应 4.19 的包
alvin666
2019-03-23 09:52:38 +08:00
@x1596357 但是我感觉很迷的是官方仓库里面有 4.19 的内核,没有 4.19 的头...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/547555

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX