Error in updating the kernel

Updating to newest kernel using dnf upgrade constantly fails.

Running transaction
  Preparing        :                                                                                                                                                                      1/1 
  Installing       : kernel-modules-core-6.9.12-200.fc40.x86_64                                                                                                                           1/4 
error: failed to open dir lib of /lib/modules/6.9.12-200.fc40.x86_64/: Not a directory

Error unpacking rpm package kernel-modules-core-6.9.12-200.fc40.x86_64
  Installing       : kernel-core-6.9.12-200.fc40.x86_64                                                                                                                                   2/4 
error: unpacking of archive failed on file /lib/modules/6.9.12-200.fc40.x86_64/build;66af085d: cpio: open failed - Not a directory
error: kernel-modules-core-6.9.12-200.fc40.x86_64: install failed
error: failed to open dir lib of /lib/: Not a directory

Error unpacking rpm package kernel-core-6.9.12-200.fc40.x86_64
  Installing       : kernel-modules-6.9.12-200.fc40.x86_64                                                                                                                                3/4 
error: unpacking of archive failed on file /lib/modules: cpio: open failed - Not a directory
error: kernel-core-6.9.12-200.fc40.x86_64: install failed
error: failed to open dir lib of /lib/modules/6.9.12-200.fc40.x86_64/kernel/drivers/acpi/: Not a directory

Error unpacking rpm package kernel-modules-6.9.12-200.fc40.x86_64
  Installing       : kernel-6.9.12-200.fc40.x86_64                                                                                                                                        4/4 
error: unpacking of archive failed on file /lib/modules/6.9.12-200.fc40.x86_64/kernel/drivers/acpi/video.ko.xz;66af085d: cpio: open failed - Not a directory
error: kernel-modules-6.9.12-200.fc40.x86_64: install failed


Installed:
  kernel-6.9.12-200.fc40.x86_64                                                                                                                                                               
Failed:
  kernel-core-6.9.12-200.fc40.x86_64                         kernel-modules-6.9.12-200.fc40.x86_64                         kernel-modules-core-6.9.12-200.fc40.x86_64                        

Error: Transaction failed

ll /lib/modules/                                                                                                                                                                     1 ↵
total 4.0K
drwxr-xr-x. 9 root root 4.0K Jul 19 00:54 6.9.9-200.fc40.x86_64

Check that you have not run out of disk space, lsblk -f.
I see this as an example:

$ lsblk -f
NAME   FSTYPE  FSVER            LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1 vfat    FAT32                            A1F1-8CEC                             587.1M     2% /boot/efi
├─sda2 ext4    1.0                              7abaf8f6-60dd-4574-ac9f-acab58272b67  496.9M    42% /boot
└─sda3 btrfs                    fedora_armf40   93c96a90-cc18-4b79-a2cf-72cd79f970bf   51.6G    12% /home
                                                                                                    /
sr0    iso9660 Joliet Extension Parallels Tools 2024-06-25-19-29-11-00
zram0                                                                                               [SWAP]

The FSAVAIL is that you need to check.

If you have lots of disk space then you could relable selinux.

sudo touch /.autorelable
sudo reboot

Try the dnf update kernel again.

Disk space seems fine

lsblk -f
NAME        FSTYPE FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
zram0                                                                                   [SWAP]
nvme0n1                                                                                 
├─nvme0n1p1 vfat   FAT32 SYSTEM_DRV 9ACE-3675                             122.3M    52% /boot/efi
├─nvme0n1p2                                                                             
├─nvme0n1p3 ntfs         Windows    323ACED93ACE996D                                    
├─nvme0n1p4 ntfs         Data       0460ABE260ABD8A6                      371.7G    47% /mnt/Data
├─nvme0n1p5 ntfs         WINRE_DRV  8E80CF5380CF4107                                    
├─nvme0n1p6 ext4   1.0              89bc8c9f-ed74-4b17-b6da-a7848906f630  709.9M    20% /boot
└─nvme0n1p7 ext4   1.0   Fedora     23eda8d1-fda0-45a3-9c5a-be86a5a33eb1   85.3G    25% /


Relabeling selinux doesn’t fix either

/lib is supposed to be a symlink to /usr/lib, are both still intact?

There might be a problem with the symlink.

1 Like

symlink was intact. But the problem was ownership of the link was changed to user. Once I changed it back to root user, kernel upgrade worked. Appreciate the help :slightly_smiling_face:.

2 Likes