I have upgraded to the latest kernel release.

The upgrade process does not finish. When trying manually (on the terminal), I get:

Setting up linux-image-4.13.0-25-generic (4.13.0-25.29) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.13.0-25-generic
) points to /boot/vmlinuz-4.13.0-25-generic
 (/boot/vmlinuz-4.13.0-25-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.13.0-25-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic

I tried, as suggested in the comments, to remove nvidia drivers and the kernel-image. But this results basically in the same problem:

$ sudo apt-get purge linux-image-4.13.0-25-generic *nvidia*
The following packages will be REMOVED:
  linux-image-4.13.0-25-generic* linux-image-extra-4.13.0-25-generic nvidia-384* nvidia-opencl-icd-384* nvidia-prime*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 235 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 210977 files and directories currently installed.)
Removing linux-image-extra-4.13.0-25-generic (4.13.0-25.29) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic

For me this was connected to the proprietary nvidia drivers (version 385). I removed them using the "Software & Updates -> Additional Drivers" Tab. Afterwards I manually uninstalled the linux-image-4.13.0-25-generic package with:

sudo apt-get remove linux-image-4.13.0-25-generic

And ran:

sudo apt-get install -f && sudo apt-get upgrade

After a reboot my system was running the newest kernel and I was able to install the newest nvidia drivers.


In case the process is hanging apparently killing the plymouth service is supposed to help (See Launchpad). In a new terminal type

sudo pkill plymouth

The installation should proceed.

edit 2:

As /op mentioned after everything works again reinstall the linux-image-generic package to update the kernel to the newest version:

sudo apt-get install linux-image-generic
| improve this answer | |
  • Sounds like a plan. But how can I kill the hanging update process? It does not respond to Ctrl-C. – kerner1000 Jan 11 '18 at 13:17
  • Use xkill from a terminal and click on the program that is running the update (Terminal, Updates or Software Center). Afterwards you might need to delete the dpkg lockfile and / or update files in /var/lib/dpkg. – byf-ferdy Jan 11 '18 at 13:27
  • kill worked. Removing nvidia and also the kernel image will bring me again to the same place. See updated question. – kerner1000 Jan 11 '18 at 13:33
  • Question updated. Give sudo pkill plymouth a try :) – byf-ferdy Jan 11 '18 at 15:11
  • 1
    Dont forget to reinstall the meta package linux-image-generic afterwards, which was removed together with linux-image-4.13.0-25-generic. This will also reinstall linux-image-4.13.0-25-generic – kerner1000 Jan 11 '18 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.