If you're in this inconsistent state and dpkg requires to reinstall the packages you can force the removal of the package with dpkg option --force-remove-reinstreq
For instance: dpkg --purge --force-remove-reinstreq linux-headers-6.5.0-10-generic To list the packages that are half-installed use: dpkg -l "linux-headers*" Note that kernel headers are not the only package affected but everything that tries to write to kernel-protected directories will be, such as extra modules or firmware. This is a known issue and is being worked on. -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/2034688 Title: installation of kernel headers fail with "Read-only file system" error Status in ubuntu-desktop-installer: Triaged Status in linux package in Ubuntu: In Progress Bug description: Mantic 20230907 Installation of packages that ship files in /lib/modules or /lib/firmware are expected to fail, so their installation must be prevented. For instance: $ apt install linux-headers-generic-6.3.0-7 Reading package lists... Building dependency tree... Reading state information... linux-headers-6.3.0-7 is already the newest version (6.3.0-7.7). The following packages will be upgraded: linux-headers-6.3.0-7-generic 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 51 not fully installed or removed. Need to get 0 B/3,667 kB of archives. After this operation, 27.9 MB of additional disk space will be used. (Reading database ... 132615 files and directories currently installed.) Preparing to unpack .../linux-headers-6.3.0-7-generic_6.3.0-7.7_amd64.deb ... Unpacking linux-headers-6.3.0-7-generic (6.3.0-7.7) over (6.3.0-7.7) ... dpkg: error processing archive /var/cache/apt/archives/linux-headers-6.3.0-7-generic_6.3.0-7.7_amd64.deb (--unpack): error creating symbolic link './lib/modules/6.3.0-7-generic/build': Read-only file system dpkg: error while cleaning up: unable to remove newly-extracted version of '/lib/modules/6.3.0-7-generic/build': Read-only file system Errors were encountered while processing: /var/cache/apt/archives/linux-headers-6.3.0-7-generic_6.3.0-7.7_amd64.deb To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-desktop-installer/+bug/2034688/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp