TL;博士
我无法强制我的 ubuntu 服务器从 18.04.1 升级到 18.04.2 后,将内核升级到相应的 4.18 版本。
历史背景
昨天我跑
sudo apt upgrade
并且在其中一个次要文件上发生了冲突(我认为是/etc/issue.net
)。不幸的是,在解决该冲突期间,我不小心关闭了腻子……当我重新登录时,我锁定了apt
数据库。我重新启动服务器并执行
sudo dpkg --configure -a
然后sudo apt upgrade
就顺利了。重新启动服务器后,我在欢迎消息中看到我的系统已更新,但内核仍为 4.15 版本。
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-45-generic x86_64)
到目前为止我尝试过的
我尝试了所有可以在 Internet 上找到的解决方案,但没有一个有帮助:
rychu@RychuSRV:~$ sudo apt update
Hit:1 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 177 kB in 1s (161 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
rychu@RychuSRV:~$ sudo apt-get install linux-image-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-image-generic is already the newest version (4.15.0.45.47).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
rychu@RychuSRV:~$ sudo apt-get install linux-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-generic is already the newest version (4.15.0.45.47).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
rychu@RychuSRV:~$ uname -r && dpkg --get-selections linux
4.15.0-45-generic
linux-base install
linux-firmware install
linux-generic install
linux-headers-4.15.0-45 install
linux-headers-4.15.0-45-generic install
linux-headers-generic install
linux-image-4.15.0-23-generic deinstall
linux-image-4.15.0-29-generic deinstall
linux-image-4.15.0-30-generic deinstall
linux-image-4.15.0-32-generic deinstall
linux-image-4.15.0-33-generic deinstall
linux-image-4.15.0-34-generic deinstall
linux-image-4.15.0-36-generic deinstall
linux-image-4.15.0-38-generic deinstall
linux-image-4.15.0-39-generic deinstall
linux-image-4.15.0-42-generic deinstall
linux-image-4.15.0-43-generic install
linux-image-4.15.0-44-generic install
linux-image-4.15.0-45-generic install
linux-image-generic install
linux-modules-4.15.0-23-generic deinstall
linux-modules-4.15.0-29-generic deinstall
linux-modules-4.15.0-30-generic deinstall
linux-modules-4.15.0-32-generic deinstall
linux-modules-4.15.0-33-generic deinstall
linux-modules-4.15.0-34-generic deinstall
linux-modules-4.15.0-36-generic deinstall
linux-modules-4.15.0-38-generic deinstall
linux-modules-4.15.0-39-generic deinstall
linux-modules-4.15.0-42-generic deinstall
linux-modules-4.15.0-43-generic install
linux-modules-4.15.0-44-generic install
linux-modules-4.15.0-45-generic install
linux-modules-extra-4.15.0-23-generic deinstall
linux-modules-extra-4.15.0-29-generic deinstall
linux-modules-extra-4.15.0-30-generic deinstall
linux-modules-extra-4.15.0-32-generic deinstall
linux-modules-extra-4.15.0-33-generic deinstall
linux-modules-extra-4.15.0-34-generic deinstall
linux-modules-extra-4.15.0-36-generic deinstall
linux-modules-extra-4.15.0-38-generic deinstall
linux-modules-extra-4.15.0-39-generic deinstall
linux-modules-extra-4.15.0-42-generic deinstall
linux-modules-extra-4.15.0-43-generic install
linux-modules-extra-4.15.0-44-generic install
linux-modules-extra-4.15.0-45-generic install
rychu@RychuSRV:~$ sudo update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-45-generic
Found initrd image: /boot/initrd.img-4.15.0-45-generic
Found linux image: /boot/vmlinuz-4.15.0-44-generic
Found initrd image: /boot/initrd.img-4.15.0-44-generic
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Adding boot menu entry for EFI firmware configuration
done
rychu@RychuSRV:~$ sudo reboot
和...
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-45-generic x86_64)
rychu@RychuSRV:~$ uname -r
4.15.0-45-generic
我也试过
rychu@RychuSRV:~$ sudo do-release-upgrade
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS develoment release
set Prompt=normal in /etc/update-manager/release-upgrades.
请帮忙。
您可以通过运行升级内核并使其升级到未来的 Ubuntu 版本
至于现在它将安装 4.18 内核。
我认为您应该很高兴继续使用 4.15 内核系列
来自 Ubuntu 邮件论坛中的对话,Adam Conrad 的回答,
如果真要升级到新的内核系列,就得升级硬件使能栈,风险很大。您绝对不应该在没有完整备份的情况下执行此操作,以便在升级出错时可以轻松(?)恢复系统。
请参阅此链接:wiki.ubuntu.com/Kernel/LTSEnablementStack
我有一个带有 Ubuntu 20.04 和 18.04的双启动系统。我想升级18.04(服务器)的内核使用了这个命令:
sudo apt install linux-generic-hwe-18.04
但它不会更新。我的问题是启动时加载的 grubloader 是在 Ubuntu 20 中配置的,并且位于另一个分区上。所以我必须启动到 Ubuntu 20 并在那里运行这个命令:
grub install-update
在 grubloader 更新为带有新内核的 Ubuntu 18.04 的默认条目之后