为什么在“ apt install”之后我的Debian 9(Stretch)Linux内核没有得到升级?


12

我在本月的大部分时间中尝试安装,重新安装,手动删除,以及将最新的linux-image-4.9.0-8(或以下版本)重新安装到我的Debian 9(Stretch)上,但是它将始终(重新)引导错误版本的Linux 3.16.0-5。

我什至删除了整个/boot目录内容,然后重新安装。

我有一个标准的Debian 9安装到/dev/sda驱动器,其中/dev/sda1/boot独立的分区。

我的清单:

  • 检查了《Debian管理手册》
  • 硬件中没有UEFI引导程序
  • 在中关闭imageramfs选项 /etc/kernel-img.conf
  • 没有花哨的内核模块(甚至没有NVIDIA和ATI)
  • 正确使用apt代替apt-get

这是我遇到的一个难题系统。

最新的目录/boot是:

$ ls -lat /boot
total 106000
drwxr-xr-x 23 root root     4096 Jan 17 12:25 ..
drwxr-xr-x  2 root root     4096 Jan 17 12:17 grub
drwxr-xr-x  3 root root     4096 Jan 17 12:17 .
-rw-r--r--  1 root root 19595458 Jan 17 12:17 initrd.img-4.9.0-8-amd64
-rw-r--r--  1 root root 19446192 Jan 17 12:08 initrd.img-4.9.0-5-amd64
-rw-r--r--  1 root root 19587298 Nov  7 13:58 initrd.img-4.9.0-7-amd64
-rw-r--r--  1 root root   186563 Oct 27 14:46 config-4.9.0-8-amd64
-rw-r--r--  1 root root  3195896 Oct 27 14:46 System.map-4.9.0-8-amd64
-rw-r--r--  1 root root  4232992 Oct 27 14:46 vmlinuz-4.9.0-8-amd64
-rw-r--r--  1 root root   186568 Aug 13 15:31 config-4.9.0-7-amd64
-rw-r--r--  1 root root  3192069 Aug 13 15:31 System.map-4.9.0-7-amd64
-rw-r--r--  1 root root  4232992 Aug 13 15:31 vmlinuz-4.9.0-7-amd64
-rw-r--r--  1 root root 19478453 Feb 19  2018 initrd.img-4.9.0-3-amd64
-rw-r--r--  1 root root   186473 Jan  4  2018 config-4.9.0-5-amd64
-rw-r--r--  1 root root  3185098 Jan  4  2018 System.map-4.9.0-5-amd64
-rw-r--r--  1 root root  4216608 Jan  4  2018 vmlinuz-4.9.0-5-amd64
-rw-r--r--  1 root root   186386 Sep 18  2017 config-4.9.0-3-amd64
-rw-r--r--  1 root root  3180929 Sep 18  2017 System.map-4.9.0-3-amd64
-rw-r--r--  1 root root  4204320 Sep 18  2017 vmlinuz-4.9.0-3-amd64

注意,没有Linux 3.16.0-5 image / initramfs。

但是执行uname 总是会导致:

Linux arca 3.16.0-5-amd64 #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08)

顶级目录内容及其符号链接也正确:

# ls -lat /
total 112
drwxrwxrwt  14 root root 11264 Jan 17 13:15 tmp
drwxr-xr-x  33 root root  1080 Jan 17 12:46 run
drwxr-xr-x  19 root root  3480 Jan 17 12:45 dev
drwxr-xr-x 178 root root 12288 Jan 17 12:45 etc
dr-xr-xr-x  13 root root     0 Jan 17 12:44 sys
dr-xr-xr-x 195 root root     0 Jan 17 12:44 proc
drwx------  36 root root  4096 Jan 17 12:44 root
drwxr-xr-x  23 root root  4096 Jan 17 12:25 .
drwxr-xr-x  23 root root  4096 Jan 17 12:25 ..
drwxr-xr-x   3 root root  4096 Jan 17 12:17 boot
drwxr-xr-x   2 root root 12288 Jan 17 11:27 sbin
drwxrwxr-x   2 root root  4096 Jan 17 11:27 bin
lrwxrwxrwx   1 root root    29 Nov  7 13:56 initrd.img -> boot/initrd.img-4.9.0-8-amd64
lrwxrwxrwx   1 root root    29 Nov  7 13:56 initrd.img.crap -> boot/initrd.img-4.9.0-7-amd64
lrwxrwxrwx   1 root root    26 Nov  7 13:56 vmlinuz -> boot/vmlinuz-4.9.0-8-amd64
lrwxrwxrwx   1 root root    26 Nov  7 13:56 vmlinuz.crap.4.9.0.7 -> boot/vmlinuz-4.9.0-7-amd64
drwxr-xr-x   6 root root  4096 Oct 11 17:01 opt
drwxr-xr-x  20 root root  4096 Oct 10 16:52 lib
drwxr-xr-x   3 root root  4096 Oct 10 16:34 srv
drwxr-xr-x   8 root root  4096 Sep  5 13:34 home
drwxr-xr-x  13 root root  4096 Mar 17  2018 var
drwxr-xr-x   2 root root  4096 Mar 17  2018 lib64
drwxr-xr-x   7 root root  4096 Feb 19  2018 media
drwxr-xr-x   2 root root  4096 Feb 19  2018 debootstrap
drwxr-xr-x  10 root root  4096 May 16  2017 usr
drwxr-xr-x   2 root root  4096 Oct  8  2016 mnt
drwx------   2 root root 16384 Oct  8  2016 lost+found

即使是引导分区sda1/boot正确标记。

# fdisk /dev/sda

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xfa4b1728

Device     Boot  Start        End    Sectors   Size Id Type
/dev/sda1  *      2048     499711     497664   243M 83 Linux
/dev/sda2       501758 1953523711 1953021954 931.3G  5 Extended
/dev/sda5       501760 1953523711 1953021952 931.3G 8e Linux LVM

Partition 2 does not start on physical sector boundary.

Command (m for help): quit

Answers:


17

可能您正在使用UEFI,而/boot引导加载程序所使用的不是您列出的目录,而是一个已卸载的vfat分区。在升级内核之前,将其检入/etc/fstab,如果有单独的/boot分区,mount /boot则将其检入。

如果您不想手动安装,请/boot从该noauto选项的行中删除该选项/etc/fstab


5
你一定是在跟我开玩笑。作为长期使用Slackware的用户,我忘记了/ boot挂载点。快速检查/ etc / mtab显示未安装/ boot。一旦安装了/ boot,Fred取下了面具,Velma说“有”,谜底就解决了。
约翰·格林

3
原来,以前的系统管理员习惯是不按CISecurity准则“建议”的方式挂载(通过“ noauto”选项)/ boot分区(可能是为了减少恶意途径)。常规的Debian升级路线完美无瑕,盒子重启到新的内核版本就好了。举例来说,我已经列出了未使用UEFI的情况。
约翰·格林

1
好吧,几乎每次升级gentoo框内核时,我都会遇到同样的问题__(ツ)_ //
isalgueiro

1
@EgbertS ...,如果不是那些胆小的孩子,我也会放弃的!:-P
Time4Tea
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.