Linux 小白求助内核相关智障问题 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
alvin666

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

  •  
  •   alvin666 Mar 22, 2019 2356 views
    This topic created in 2592 days ago, the information mentioned may be changed or developed.

    以我的 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 file 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 ?

    8 replies    2019-03-23 09:52:38 +08:00
    Rasphino
        1
    Rasphino  
       Mar 22, 2019 via Android   1
    从 backport 源装 linux-compiler-gcc-6-x86 呗…不过你这样折腾,我觉得还不如直接上 buster 呢
    alvin666
        2
    alvin666  
    OP
       Mar 22, 2019 via Android
    @Rasphino 那不装会有问题吗(我现在是没遇见)
    buster 我查了下是下一个 Debian,这个机器跑了些服务,主要是稳定就好,我是为了驱动,才想着升级内核的
    billlee
        3
    billlee  
       Mar 22, 2019   1
    @alvin666 #2 不知道你是要内核自带的驱动还是要另外编译内核模块,如果要编译内核模块,linux-header 必须和 linux-image 的版本相同
    alvin666
        4
    alvin666  
    OP
       Mar 22, 2019 via Android
    @billlee 需要内核自带的,是一个新出的网卡
    那所以说我如果不用 backport 装 linuxheader,正常使用也没问题?我看编译软件啥的也没问题
    billlee
        5
    billlee  
       Mar 22, 2019   1
    @alvin666 #4 没有问题,kernel headers 一般就在编译内核模块或者 libc 的时候需要。编译其它软件只需要 libc 的 headers
    Rasphino
        6
    Rasphino  
       Mar 22, 2019 via Android   1
    header 最常用来编译内核 dkms 模块…如果你不用 dkms 的话,不装问题也不大
    x1596357
        7
    x1596357  
       Mar 23, 2019 via iPhone   1
    apt 你要指定从 backports 装才搜索到你对应 4.19 的包
    alvin666
        8
    alvin666  
    OP
       Mar 23, 2019 via Android
    @x1596357 但是我感觉很迷的是官方仓库里面有 4.19 的内核,没有 4.19 的头...
    About     Help     Advertise     Blog     API     FAQ     Solana     3620 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 40ms UTC 04:35 PVG 12:35 LAX 21:35 JFK 00:35
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86