I have been very happy with my Ubuntu 20.04.4LTS system until a few days ago when I installed the 5.13.0-40 update. When installing this update the installation process seemed to freeze removing an earlier update (cant recall which one). I waited an hour to see if it would complete but no change so forced a shutdown and reboot. System rebooted running the -40 update but was variously unstable. It might hang on the Ubuntu boot screen with the spinning wheel thing, or may go further but just freeze a short time later. Booting into the -39 kernel from the grub menus works fine, system stable as expected. Booting the -40 the same way gives same problems.
Basic system
Dual boot, Ubuntu and W10,
ASUS ROG STRIX Z690-A GAMING WIFI D4 LGA 1700 ATX Motherboard,
Intel Core i7-12700K 12 Core,
Corsair Vengeance RGB PRO 32GB (2x 16GB) DDR4 3600MHz CL18 Memory,
2x Seagate FireCuda 530 1TB PCI-Express Gen4x4 NVMe M.2 2280-D2 SSD (one for Ubuntu, one for W10),
ASUS GeForce RTX 3080 TUF Gaming OC V2 10GB Video Card - LHR Version,
LG UltraGear 34in UWQHD IPS 165Hz G-Sync Compatible FreeSync Curved Gaming Monitor (34GN850-B),
Corsair Keyboard.
Any help debugging would be very much appreciated. Will gladly run any commands and supply output to assist in diagnosis.
Peter
Thank you Joepie Es for your assistance.
I altered grub to boot the -39 system. Then followed your instructions (with a little edit to add the "-generic" to packages I was removing. This left me with a single function version of the system, -39 which boots and runs without problems.
Where to now? Do I just cut my losses and wait for the next update, or do I bother to try and get -40 correct? Is there a simple "kick off the failed update for a second try" command?
Peter
Below are the commands I executed:
$ sudo dpkg --list | grep linux-image
rc linux-image-5.11.0-27-generic 5.11.0-27.29~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.11.0-43-generic 5.11.0-43.47~20.04.2 amd64 Signed kernel image generic
rc linux-image-5.11.0-44-generic 5.11.0-44.48~20.04.2 amd64 Signed kernel image generic
rc linux-image-5.11.0-46-generic 5.11.0-46.51~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.13.0-25-generic 5.13.0-25.26~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.13.0-27-generic 5.13.0-27.29~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.13.0-28-generic 5.13.0-28.31~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.13.0-30-generic 5.13.0-30.33~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.13.0-35-generic 5.13.0-35.40~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.13.0-37-generic 5.13.0-37.42~20.04.1 amd64 Signed kernel image generic
ii linux-image-5.13.0-39-generic 5.13.0-39.44~20.04.1 amd64 Signed kernel image generic
ii linux-image-5.13.0-40-generic 5.13.0-40.45~20.04.1 amd64 Signed kernel image generic
ii linux-image-generic-hwe-20.04 5.13.0.40.45~20.04.25 amd64 Generic Linux kernel image
Then
$ uname -r
5.13.0-39-generic
Then
$ sudo apt purge linux-headers-5.13.0-40-generic linux-image-5.13.0-40-generic linux-modules-5.13.0-40-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
amd64-microcode intel-microcode iucode-tool linux-hwe-5.13-headers-5.13.0-40 thermald
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
linux-generic-hwe-20.04* linux-headers-5.13.0-40-generic* linux-headers-generic-hwe-20.04* linux-image-5.13.0-40-generic*
linux-image-generic-hwe-20.04* linux-modules-5.13.0-40-generic* linux-modules-extra-5.13.0-40-generic*
0 to upgrade, 0 to newly install, 7 to remove and 2 not to upgrade.
After this operation, 432 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 296137 files and directories currently installed.)
Removing linux-generic-hwe-20.04 (5.13.0.40.45~20.04.25) ...
Removing linux-headers-generic-hwe-20.04 (5.13.0.40.45~20.04.25) ...
Removing linux-headers-5.13.0-40-generic (5.13.0-40.45~20.04.1) ...
Removing linux-image-generic-hwe-20.04 (5.13.0.40.45~20.04.25) ...
Removing linux-modules-extra-5.13.0-40-generic (5.13.0-40.45~20.04.1) ...
Removing linux-modules-5.13.0-40-generic (5.13.0-40.45~20.04.1) ...
Removing linux-image-5.13.0-40-generic (5.13.0-40.45~20.04.1) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: nvidia 510.60.02 (5.13.0-40-generic) (x86_64)
-------- Uninstall Beginning --------
Module: nvidia
Version: 510.60.02
Kernel: 5.13.0-40-generic (x86_64)
-------------------------------------
Status: Before uninstall, this module version was ACTIVE on this kernel.
nvidia.ko:
- Uninstallation
- Deleting from: /lib/modules/5.13.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-modeset.ko:
- Uninstallation
- Deleting from: /lib/modules/5.13.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-drm.ko:
- Uninstallation
- Deleting from: /lib/modules/5.13.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-uvm.ko:
- Uninstallation
- Deleting from: /lib/modules/5.13.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-peermem.ko:
- Uninstallation
- Deleting from: /lib/modules/5.13.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
DKMS: uninstall completed.
I: /boot/vmlinuz is now a symlink to vmlinuz-5.13.0-39-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.13.0-39-generic
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.13.0-40-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.13.0-39-generic
Found initrd image: /boot/initrd.img-5.13.0-39-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done
(Reading database ... 279632 files and directories currently installed.)
Purging configuration files for linux-modules-extra-5.13.0-40-generic (5.13.0-40.45~20.04.1) ...
Purging configuration files for linux-modules-5.13.0-40-generic (5.13.0-40.45~20.04.1) ...
dpkg: warning: while removing linux-modules-5.13.0-40-generic, directory '/lib/modules/5.13.0-40-generic' not empty so not removed
Purging configuration files for linux-image-5.13.0-40-generic (5.13.0-40.45~20.04.1) ...
rmdir: failed to remove '/lib/modules/5.13.0-40-generic': Directory not empty
(the /lib/modules/5.13.0-40-generic/misc directory contained 3 virtualbox files that were also contained in the -39-generic/misc directory
so I removed the non empty directory tree from and including /lib/modules/5.13.0-40-generic )