0

i was running "sudo apt upgrade" but it was failed cus the vm turn off, so i tried to run upgrade again and it says i should run "sudo dpkg --configure -a", so i tried it didnt finish till i wait about 30 minutes, is it really that long?

$ sudo dpkg --configure -a
Setting up initramfs-tools (0.140ubuntu13.4) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.140ubuntu13.4) ...
update-initramfs: Generating /boot/initrd.img-5.15.0-92-generic
rusty
  • 16,327
  • That is indeed the step that takes the longest for me. If you want to see which file it is stuck on you can run sudo update-initramfs -u -v separately – Daniel T Feb 02 '24 at 07:15
  • @DanielT its stuck here

    Adding module /lib/modules/5.15.0-92-generic/kernel/drivers/md/raid10.ko

    can you help this?

    – deeeeeeeeeee Feb 02 '24 at 07:40
  • Are you out disk space in /boot or out of RAM? Otherwise try reinstalling it with apt reinstall linux-modules-5.15.0-92-generic, and if that does work apt download linux-modules-5.15.0-92-generic, then sudo dpkg --force-all -i <name_of_that_new_deb_file> – Daniel T Feb 02 '24 at 07:51
  • @DanielT disk space is OK for the VM RAM is still available 1 GB, does this effect with speed process ? also im running the sudo dpkg --force-all -i linux-modules-5.15.0-92-generic_5.15.0-92.102_amd64.deb – deeeeeeeeeee Feb 02 '24 at 08:00
  • I measured that command using cgroups to have a memory.peak RAM usage of 330.39844 MiB, so it shouldn't be the problem. Are you using RAID? If not, you can try deleting raid10.ko before reinstalling it with that dpkg command. You should also check the disk for errors using fsck and badblocks (read some answers first to avoid data loss), and your memory with memtest86. Is memory usage or disk usage high (check htop) when it gets stuck? – Daniel T Feb 02 '24 at 08:08
  • im not using RAID how do i delete raid10.ko? @DanielT, also the memory usage didnt go high when it gets stuck – deeeeeeeeeee Feb 02 '24 at 08:16
  • Oh well, just ignore what I said about deleting it. I only said that to try and see if having the file rewritten in a new part of the disk would help. But that is made unnecessary if you do fsck and badblocks. That should be what comes to mind first because you said "it was failed cus the vm turn off" – Daniel T Feb 02 '24 at 08:18
  • i run fsck output /dev/vda1 is mounted. e2fsck: Cannot continue, aborting.

    so is should unmount the /dev/vda1 ? because its mounted on / directory, is it safe tho?

    – deeeeeeeeeee Feb 02 '24 at 08:23
  • run badblocks and it says no badblocks Pass completed, 0 bad blocks found. (0/0/0 errors) @DanielT – deeeeeeeeeee Feb 02 '24 at 08:29
  • You won't be able to unmount /. You need to reboot to the LiveCD, then run fsck on /dev/vda1 there. – Daniel T Feb 02 '24 at 08:34
  • @DanielT alright, i cant do that because i didnt own the VM, but i want to ask , if i keep waiting the sudo dpkg --configure -a command , does it still has chance to complete? – deeeeeeeeeee Feb 02 '24 at 08:43
  • It would have a chance to complete if there is still CPU or IO activity going on. Check htop, top or iotop to see if there is any more activity. Also check dmesg to see if there are any disk errors being reported. See https://askubuntu.com/a/47974/1004020 to try the /forcefsck option. – Daniel T Feb 02 '24 at 08:49
  • @DanielT also, si there any way to canceled the upgrade? because the kernel im using now is 5.15.0-52-generic so is there any way to canceled the upgrade? – deeeeeeeeeee Feb 02 '24 at 09:25
  • You could just sudo killlall dpkg, then kill related processes. But this may lead to an unbootable system if you don't remove the old GRUB entry. To do that, you could in dpkg --get-selections | grep 5.15.0-92, and do sudo dpkg --force-all -r <list of package names>. This should at least lead to a bootable system, but apt will be broken so you can't install or upgrade until you fix it. – Daniel T Feb 02 '24 at 09:36

0 Answers0