5

I have an Ubuntu 14.04 LTS "Desktop" with GitLab. The system runs in a virtual machine on a Windows Server 2012 R2.

The machine runs daily automatic updates for "Important security updates", "Recommended updates" and "Unsupported updates". Not for "Pre-release updates".

Today I logged in the system, ran "sudo apt-get update" and it couldn't finish because some process is using dpkg.

I've ran "sudo apt-get upgrade" and it updated but hanged at:

Found linux image: /boot/vmlinuz-3.19.0-39-generic
Found initrd image: /boot/initrd.img.3.19.0-39-generic
Found linux image: /boot/vmlinuz-3.19.0-37-generic
Found initrd image: /boot/initrd.img.3.19.0-37-generic
Found linux image: /boot/vmlinuz-3.19.0-33-generic
Found initrd image: /boot/initrd.img.3.19.0-33-generic
Found linux image: /boot/vmlinuz-3.19.0-32-generic
Found initrd image: /boot/initrd.img.3.19.0-32-generic
Found linux image: /boot/vmlinuz-3.19.0-31-generic
Found initrd image: /boot/initrd.img.3.19.0-31-generic

I rebooted and hanged again at the same point for an "sudo apt-get upgrade".

Then I tried to clean the unused kernels. I ran:

uname -r

and got:

3.19.0-39-generic

So I removed 3.19.0-31, 3.19.0-32 and 3.19.0-33:

sudo rm /boot/initrd.img.3.19.0-31-generic
sudo rm /boot/initrd.img.3.19.0-32-generic
sudo rm /boot/initrd.img.3.19.0-33-generic
sudo rm /boot/vmlinuz-3.19.0-31-generic
sudo rm /boot/vmlinuz-3.19.0-32-generic
sudo rm /boot/vmlinuz-3.19.0-33-generic

Then, I tried to purge:

sudo apt-get purge linux-image-3.19.0-31-generic linux-image-3.19.0-32-generic linux-image-3.19.0-33-generic

But the process hanged also.
Then, I could "update" but the "upgrade" failed at:

Found linux image: /boot/vmlinuz-3.19.0-39-generic
Found initrd image: /boot/initrd.img.3.19.0-39-generic
Found linux image: /boot/vmlinuz-3.19.0-37-generic
Found initrd image: /boot/initrd.img.3.19.0-37-generic

At some update/upgrade, it suggested me to run dpkg --configure -a but it also failed at the same point above.

Also, when I reboot, the system gets stuck at the "dots screen". I have to "power off" the virtual machine and restart it to get into it.

After some apt-get update, apt-get upgrade, dpkg --configure -a and reboots I'm not sure how, but everything ran fine again.

Now I'm again with the same problems:

  1. When I run apt-get update, apt-get upgrade I get:

    E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
    
  2. When I run sudo dpkg --configure -a it hangs after:

    Found linux image: /boot/vmlinuz-3.19.0-42-generic
    Found initrd image: /boot/initrd.img-3.19.0-42-generic
    Found linux image: /boot/vmlinuz-3.19.0-39-generic
    Found initrd image: /boot/initrd.img-3.19.0-39-generic
    
  3. The system also hangs at the "dots screen" when I reboot

I'm quite noob with linux. Can anybody put some light here?

Yeray
  • 203
  • Same problem here.. I got it after trying to update "OS Updates" via the gui application named "Ubuntu Software" – Emile Vrijdags Feb 04 '17 at 11:15
  • I experienced this problem when I had an external 1TB hard drive plugged in. I don't know exactly what was going on but after I unplugged it, the hanging stopped. I think the external drive wasn't working properly, so that dpkg was looking for initrd images and went into an endless loop to try and read the drive. Very annoying! Why would it even look there... – Jan M. Apr 08 '19 at 08:36

4 Answers4

4

Temporally fixed it!

After some reboots and some attempts to apt-get update, apt-get upgrade, apt-get dist-upgrade and dpkg --configure -a, the last command finally ended successfully and the rest of commands started to also run with success.

Updated to 3.19.0-42-generic kernel during the process.

So I'm not sure what exactly caused it, neither what exactly fixed it, but anyway... :)

Yeray
  • 203
  • Unfortunately this is the only thing working right now...it would be nice for a cleaner solution but sometimes this is all you can ask for – RyanQuey May 14 '20 at 22:24
1

It looks as through at some point you upgraded your kernel and it did not fully take I would make sure the kernel is correct by running:

sudo apt-get dist-upgrade

Then update and upgrade:

sudo apt-get update && sudo apt-get upgrade

Next you can check all pakages are correct by running

sudo apt-get -f install
Wtower
  • 467
  • 9
  • 16
DnrDevil
  • 1,488
  • 1
    When I try to run sudo apt-get -f install, it tells me E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. – Yeray Jan 04 '16 at 10:37
0

I had a similar problem twice and I have noticed that it happens everytime my system wants to upgrade to a new Kernel. The steps below seem to work for me all the time;

  1. Boot into the recovery mode of your newest kernel versions.
  2. Log-in to the system as root from the drop-down menu.
  3. Edit the /etc/resolv.conf file using a text editor, I normally use vi, i.e. vi /etc/resolv.conf and put in the contents below and save file;

nameserver 208.67.222.220

nameserver 208.67.222.222

  1. After the above step, Ctrl+D (exit) back into the recovery mode menu and click on networking to enable network/internet connection.
  2. Next, click on the dpkg item to fix broken packages.

That's it, after the reboot your system should have the right kernel install and broken packages fixed/removed.

0

That’s just to configure a DNS server in order to resolve IP address mapping.

You can even use the public google server

8.8.8.8 and 8.8.4.4