I am aware that similar questions have been asked countless times, but I have not been able so far to find an appropriate match for my case.
I am running a 32-bit, 14.04 server within an OpenVZ container, which provides this kernel:
$ uname -r
2.6.32-042stab116.2
Not sure how/why it started, but apt
has been repeatedly trying (and failing) to upgrade to the 3.13 series, ending up like this:
$ dpkg -l |grep linux
ii libselinux1:i386 2.2.2-1ubuntu0.1 i386 SELinux runtime shared libraries
ii linux-firmware 1.127.22 all Firmware for Linux kernel drivers
ii linux-headers-3.13.0-100 3.13.0-100.147 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-100-generic 3.13.0-100.147 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-101 3.13.0-101.148 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-101-generic 3.13.0-101.148 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-91 3.13.0-91.138 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-91-generic 3.13.0-91.138 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-92 3.13.0-92.139 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-92-generic 3.13.0-92.139 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-93 3.13.0-93.140 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-93-generic 3.13.0-93.140 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-96 3.13.0-96.143 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-96-generic 3.13.0-96.143 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
iF linux-image-3.13.0-92-generic 3.13.0-92.139 i386 Linux kernel image for version 3.13.0 on 32 bit x86 SMP
iF linux-image-3.13.0-93-generic 3.13.0-93.140 i386 Linux kernel image for version 3.13.0 on 32 bit x86 SMP
iF linux-image-3.13.0-96-generic 3.13.0-96.143 i386 Linux kernel image for version 3.13.0 on 32 bit x86 SMP
rH linux-image-extra-3.13.0-100-generic 3.13.0-100.147 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
rH linux-image-extra-3.13.0-101-generic 3.13.0-101.148 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
rH linux-image-extra-3.13.0-92-generic 3.13.0-92.139 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
iU linux-image-extra-3.13.0-93-generic 3.13.0-93.140 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
iU linux-image-extra-3.13.0-96-generic 3.13.0-96.143 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii linux-libc-dev:i386 3.13.0-101.148 i386 Linux Kernel Headers for development
ii syslinux 3:4.05+dfsg-6+deb8u1 i386 collection of boot loaders
ii syslinux-common 3:4.05+dfsg-6+deb8u1 all collection of boot loaders (common files)
ii util-linux 2.20.1-5.1ubuntu20.7 i386 Miscellaneous system utilities
My understanding is that the kernel is entirely under the OpenVZ host's responsibility, and I have been advised to simply get rid of all these images, which are ignored by the system anyway. However, all my attempts to completely remove the packages have failed with various error messages.
This is what happened when I tried to explicitly purge all unwanted linux* packages.
Using aptitude instead of apt-get got rid of a a few packages and changed the status of all remaining images to pH
, but did not resolve the problem:
$ dpkg -l |grep linux
ii libselinux1:i386 2.2.2-1ubuntu0.1 i386 SELinux runtime shared libraries
ii linux-firmware 1.127.22 all Firmware for Linux kernel drivers
ii linux-headers-3.13.0-100 3.13.0-100.147 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-100-generic 3.13.0-100.147 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-91 3.13.0-91.138 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-91-generic 3.13.0-91.138 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-92 3.13.0-92.139 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-92-generic 3.13.0-92.139 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-93 3.13.0-93.140 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-93-generic 3.13.0-93.140 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
ii linux-headers-3.13.0-96 3.13.0-96.143 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-96-generic 3.13.0-96.143 i386 Linux kernel headers for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-100-generic 3.13.0-100.147 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-101-generic 3.13.0-101.148 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-92-generic 3.13.0-92.139 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-93-generic 3.13.0-93.140 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-96-generic 3.13.0-96.143 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii linux-libc-dev:i386 3.13.0-101.148 i386 Linux Kernel Headers for development
ii syslinux 3:4.05+dfsg-6+deb8u1 i386 collection of boot loaders
ii syslinux-common 3:4.05+dfsg-6+deb8u1 all collection of boot loaders (common files)
ii util-linux 2.20.1-5.1ubuntu20.7 i386 Miscellaneous system utilities
I ran aptitude again on the above list of 3.13 packages, and this time all headers were gone, but the "extra" images are still there.
$ dpkg -l |grep linux
pH linux-image-extra-3.13.0-100-generic 3.13.0-100.147 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-101-generic 3.13.0-101.148 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-92-generic 3.13.0-92.139 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-93-generic 3.13.0-93.140 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
pH linux-image-extra-3.13.0-96-generic 3.13.0-96.143 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
[...]
I gave it yet another go, and this is the output. It looks as though in order to purge these extra images (with obvious unmet dependencies, since the corresponding images are gone) some files required by aptitude
are missing:
depmod: FATAL: could not load /boot/System.map-3.13.0-100-generic: No such file or directory
dpkg -l
command, for some versions you have thelinux-image-extra
packages installed but not the correspondinglinux-image
ones. That's not a good thing, those two packages should always go together. And now you have this for all versions, which is why you can't uninstall thelinux-image-extra
packages. You should reinstall thelinux-image
packages, and then be sure to always removelinux-image
andlinux-image-extra
together. – fkraiem Nov 28 '16 at 08:24apt-get -f install
may also help to install the missinglinux-image
packages, bringing you back to a stable state where you can then uninstall everything. – fkraiem Nov 28 '16 at 08:28apt-get
oraptitude
. I would not dare manually delete stuff. Now, do you meanapt-get -f install
followed by the list of*image*
and*image-extra*
for all the versions? (92, 93, 96, 100, 101) – Giuseppe Nov 28 '16 at 08:41apt-get -f install
should be run by itself. – fkraiem Nov 28 '16 at 08:42apt-get -f install
by itself will try to REMOVE/PURGE the image-extras, again resulting in errors. – Giuseppe Nov 28 '16 at 10:55