8

Today I wanted to install virtualbox (4.2) in Ubuntu 12.10 and went to the Software Center. After clicking on the 'Install' button in the USC virtualbox was being downloaded and installed. I waited more than five minutes but nothing happened, and the progress bar didn't change. After about one hour of waiting I closed the USC and rebooted the PC.

Now I have got the problem that whenever I want to install software via sudo apt-get install <software> I get the following error:

quantal@Flubuntu:~$ sudo apt-get install <whatever-package>
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

After killing dpkg in terminal (sudo killall dpkg) or rebooting I get the next error:

quantal@Flubuntu:~$ sudo apt-get install <whatever-package>
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct

And when I try to execute sudo dpkg --configure -a the command hangs at

update-initramfs: Generating /boot/initrd.img-3.5.0-25-generic

When I start sudo update-initramfs -k all -u -v in verbose mode it says that it adds many modules, binaries and firmware (which I have not included in the output) but then is stuck after the following six lines:

Adding binary /lib/firmware/radeon/TAHITI_me.bin
Adding firmware radeon/TAHITI_me.bin
Adding binary /lib/firmware/radeon/TAHITI_pfp.bin
Adding firmware radeon/TAHITI_pfp.bin
Adding module /lib/modules/3.5.0-23-generic/kernel/drivers/gpu/drm/i2c/sil164.ko
Adding module /lib/modules/3.5.0-23-generic/kernel/drivers/gpu/drm/i2c/ch7006.ko

Blacklisting ch7006 or the module before doesn't work; I have also tried to manually rename ch7006.ko and sil164.ko (after checking that it isn't necessary for the system) but then it is stuck at the line before.

Many thanks in advance!

Further information:

NOTE: When booting Ubuntu I get NO errors or so, so the kernel boots but I cannot update it (and apt-get install doesn't want to install software as long as this problem exists).

The output of uname -a:

Linux Flubuntu 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:15:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
1
  • 1
    sudo update-initramfs -k all -u -v helped. Apr 6, 2022 at 9:15

4 Answers 4

5

Today I've also encountered this error and removing then reinstalling initramfs-tools have fixed the hangs I've been experiencing.

sudo apt remove initramfs-tools
sudo apt install initramfs-tools

In my case, it was probably some configuration or a temporary file was broken / locked for initramfs-tools.

This was on Ubuntu 18.04 so it can still happen.

0
3

Okay, I have found a workaround to fix this error.

  1. After I executed the steps in my question, I tried to remove the kernel with:

    sudo update-initramfs -k 3.5.0-23-generic -d
    
  2. After a reboot GRUB showed up and selected my version of Ubuntu but when it tried to load the kernel, it said

    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0)

  3. Then I just chrooted with a LiveCD into Ubuntu and executed:

    sudo dpkg --configure -a
    sudo apt-get install linux-image-3.5.0-25-generic
    

    And after a reboot everything was OK.

2
  • Step 2 sounds to be likely unnecessary. Instead you can directly run sudo apt-get install -f from the currently running system (no need to reboot or use a live system) after update-initramfs -d. Sep 5, 2018 at 17:29
  • After step 1, instead try running dpkg-reconfigure linux-image-<kernel-version>-generic.. Even if you do reboot and hit this kernel panic, you can choose the previous kernel version from the GRUB menu and boot to the live system rather than using a LiveCD and chrooting, then do a dpkg-reconfigure.
    – jefflarkin
    Aug 26, 2022 at 1:59
3

Step 2 of slashcrack’s sounds largely unnecessary. Instead it should suffice to run

sudo update-initramfs -d -k <VERSION>
sudo apt-get install -f

where you replace <VERSION> with the affected kernel version string (here: 3.5.0-23-generic).

1
  • To find the current version of initramfs you can also just see it under /lib/modules/ directory.
    – T.Todua
    Dec 30, 2019 at 17:15
3

so I found a major reason for myself on update-initramfs would get stuck.

problematic usb drives. if a usb drive would be connected but in a stuck state, it would just hang. if the usb device device would be removed (physically) the system would realize it, and whatever was hung on it, would get unhung and continue.

In practice, I really think whatever it is doing (os-prober or something else) should be generally smart enough to skip removable disks, unless specifically configured to not (ex: if installing ubuntu onto a removable disk, then it mark it as true to scan removable media, if installing to a fixed disk, then it wouldn't, though in both cases could be modified to change behavior. But this is more of a bug fix, the practical fix (for me) is above. dis

2
  • This was my problem. Thanks!
    – glaroc
    Jan 19, 2022 at 15:54
  • This was my problem too. Once I unplugged the problematic USB drive the problem went away.
    – jefflarkin
    Aug 26, 2022 at 1:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .