I have an old Ubuntu 16.04 install that is beginning to give me a tonne of
grief with apt.
It has now happily upgraded (well) past kernel 4.4.0-210, but it's refusing
to go further because it can't remove -210 any more:
# apt remove --purge linux-modules-extra-4.4.0-210-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
linux-headers-4.4.0-210-generic linux-modules-4.4.0-210-generic
linux-modules-extra-4.4.0-210-generic
0 to upgrade, 0 to newly install, 3 to remove and 18 not to upgrade.
3 not fully installed or removed.
After this operation, 225 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 149323 files and directories currently installed.)
Removing linux-headers-4.4.0-210-generic (4.4.0-210.242) ...
dpkg: error processing package linux-headers-4.4.0-210-generic (--remove):
unable to securely remove
'/usr/src/linux-headers-4.4.0-210-generic/include/config/generic/isa/dma.h':
Not a directory
Removing linux-modules-4.4.0-210-generic (4.4.0-210.242) ...
dpkg: error processing package linux-modules-4.4.0-210-generic (--remove):
unable to securely remove
'/lib/modules/4.4.0-210-generic/kernel/fs/nfs/nfsv4.ko': Not a directory
Removing linux-modules-extra-4.4.0-210-generic (4.4.0-210.242) ...
dpkg: error processing package linux-modules-extra-4.4.0-210-generic
(--remove):
unable to securely remove
'/lib/modules/4.4.0-210-generic/kernel/fs/nfs/blocklayout': Not a directory
Errors were encountered while processing:
linux-headers-4.4.0-210-generic
linux-modules-4.4.0-210-generic
linux-modules-extra-4.4.0-210-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
apt upgrades are failing as a result of this. I've been slowly reinstating
files (using touch), but is there a way to *genuinely force* apt to
remove/purge when it gets into a state like this?
Kind regards
Murray Crane