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 vmlinuz(/boot/vmlinuz-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 (hangs)
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* nvidia-settings* 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 (hangs)