Trying to remove old kernels to make space for an update (currently running 16.04.03 server):
sudo apt autoremove
gives this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run â??apt-get -f installâ?? to correct these.
The following packages have unmet dependencies.
linux-headers-generic : Depends: linux-headers-4.4.0-141-generic but it is not
installed
E: Unmet dependencies. Try using -f.
So, I run:
sudo apt -f autoremove
Doing so brings this:
The following additional packages will be installed:
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following additional packages will be installed:
linux-headers-4.4.0-141 linux-headers-4.4.0-141-generic
The following packages will be REMOVED
linux-headers-4.4.0-109 linux-headers-4.4.0-112 linux-headers-4.4.0-116
linux-headers-4.4.0-119 linux-headers-4.4.0-127 linux-headers-4.4.0-128
linux-headers-4.4.0-130 linux-headers-4.4.0-130-generic
linux-headers-4.4.0-131 linux-headers-4.4.0-131-generic
linux-headers-4.4.0-133 linux-headers-4.4.0-133-generic
linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
linux-headers-4.4.0-87 linux-image-4.4.0-130-generic
linux-image-4.4.0-131-generic linux-image-4.4.0-133-generic
linux-image-4.4.0-134-generic linux-image-extra-4.4.0-130-generic
linux-image-extra-4.4.0-131-generic linux-image-extra-4.4.0-133-generic
linux-image-extra-4.4.0-134-generic
The following NEW packages will be installed
linux-headers-4.4.0-141 linux-headers-4.4.0-141-generic
0 to upgrade, 2 to newly install, 23 to remove and 1 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/10.8 MB of archives.
After this operation, 1,387 MB disk space will be freed.
Do you want to continue? [Y/n]
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true
/etc/apt/apt.conf.d/70debconf looks like that:
// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
I can run
/usr/sbin/dpkg-preconfigure --help
There should be enough free space, or is that not enough?
df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 472M 106M 342M 24% /boot
I tried, as suggested by George Udosen:
sudo dpkg --configure -a
But that brings:
dpkg: dependency problems prevent configuration of linux-headers-generic:
linux-headers-generic depends on linux-headers-4.4.0-141-generic; however:
Package linux-headers-4.4.0-141-generic is not installed.
dpkg: error processing package linux-headers-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-headers-generic (= 4.4.0.141.147); however:
Package linux-headers-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-headers-generic
linux-generic
Just for fun, I tried the next suggested command:
sudo apt update
Which brings - after the hits:
Reading package lists... Done
E: Couldn't wait for subprocess - waitpid (10: No child processes)
Actually, when trying solutions from other threads I saw that "No child processes" a few times.
Update: Issue solved. Actually, probably it was several. Note: I run the server via Webmin. Some threads suggested that this is a Webmin issue, so before I posted here, I tried to fix the issue directly at the server, but wasn't able to do. But now ....
I found in another thread how to remove the Linux packages that create the problems:
sudo dpkg -P linux-generic
sudo dpkg -P linux-image-generic
sudo dpkg -P linux-headers-generic
That, combined possibly with George Udosen's (thanks a lot!!!) proposals, got rid of the dependency errors and made it possible to install the latest version of Webmin. The
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true
turned out to be a Webmin issue and was then gone when runing the autoremove from the server directly.
Thanks a lot for the help! The server will stand again unattended in my empty flat for some time, so it was important to get the issue solved. I can sleep again tonight.
sudo dpkg --configure -a
, thensudo apt update
and followingsudo apt install -f
and finallysudo apt autoremove
! – George Udosen Jan 03 '19 at 13:43sudo apt install -f
! – George Udosen Jan 03 '19 at 14:06sudo dpkg -P linux-generic
sudo dpkg -P linux-image-generic
sudo dpkg -P linux-headers-generic
I did that, and the firstdpkg --configure -a
went then through without problems. However, theapt update
is still the same, and theapt install -f
returns without errors, but theapt autoremove
still complains that thedpkg-preconfigure
wasn't there. – StefanProb Jan 03 '19 at 14:15dpkg
package, runsudo apt-get remove --purge dpkg && sudo apt clean && sudo apt-get install -f && sudo apt-get install dpkg && sudo dpkg --configure -a && sudo apt update
– abu-ahmed al-khatiri Jan 03 '19 at 14:29