Score:3

Why did "E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem" appear?

kz flag

For Ubuntu Desktop 18:04 for update I use:

  • sudo apt update
  • sudo apt upgrade

But suddenly for the latter now arises:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem

So executing that command I got:

sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
 linux-generic-hwe-18.04 depends on linux-headers-generic-hwe-18.04 (= 5.4.0.80.90~18.04.72); however:
  Version of linux-headers-generic-hwe-18.04 on system is 5.4.0.77.86~18.04.69.

dpkg: error processing package linux-generic-hwe-18.04 (--configure):
 dependency problems - leaving unconfigured
Setting up linux-modules-5.4.0-80-generic (5.4.0-80.90~18.04.1) ...
Setting up linux-image-5.4.0-80-generic (5.4.0-80.90~18.04.1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.4.0-77-generic
I: /initrd.img.old is now a symlink to boot/initrd.img-5.4.0-77-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-5.4.0-80-generic
I: /initrd.img is now a symlink to boot/initrd.img-5.4.0-80-generic
Setting up linux-modules-extra-5.4.0-80-generic (5.4.0-80.90~18.04.1) ...
Setting up linux-image-generic-hwe-18.04 (5.4.0.80.90~18.04.72) ...
Processing triggers for linux-image-5.4.0-80-generic (5.4.0-80.90~18.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-80-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-80-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-80-generic
Found initrd image: /boot/initrd.img-5.4.0-80-generic
Found linux image: /boot/vmlinuz-5.4.0-77-generic
Found initrd image: /boot/initrd.img-5.4.0-77-generic
Found linux image: /boot/vmlinuz-5.4.0-73-generic
Found initrd image: /boot/initrd.img-5.4.0-73-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Errors were encountered while processing:
 linux-generic-hwe-18.04

So executing

  • sudo apt update
  • sudo apt upgrade

The second now fails with:

sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-generic-hwe-18.04 : Depends: linux-headers-generic-hwe-18.04 (= 5.4.0.80.90~18.04.72) but 5.4.0.77.86~18.04.69 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

so

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-73-generic linux-hwe-5.4-headers-5.4.0-73 linux-image-5.4.0-73-generic linux-modules-5.4.0-73-generic
  linux-modules-extra-5.4.0-73-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-headers-5.4.0-80-generic linux-headers-generic-hwe-18.04 linux-hwe-5.4-headers-5.4.0-80
The following NEW packages will be installed:
  linux-headers-5.4.0-80-generic
The following packages will be upgraded:
  linux-headers-generic-hwe-18.04 linux-hwe-5.4-headers-5.4.0-80
2 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
2 not fully installed or removed.
Need to get 0 B/12.3 MB of archives.
After this operation, 85.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 210068 files and directories currently installed.)
Preparing to unpack .../linux-hwe-5.4-headers-5.4.0-80_5.4.0-80.90~18.04.1_all.deb ...
Unpacking linux-hwe-5.4-headers-5.4.0-80 (5.4.0-80.90~18.04.1) over (5.4.0-80.90~18.04.1) ...

So

  • sudo apt update
  • sudo apt upgrade

All work fine

Question

  • Why did the E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem message appear?
Score:6
us flag

E: dpkg was interrupted

You must have either turned off the computer while there was an ongoing update or software installation, or have killed the ongoing update process, and as a result, the package manager was interrupted, and the packages were corrupted.

Something like this may have happened if you turned off the computer while an unattended update (automatic updates in the background) was running.

Manuel Jordan avatar
kz flag
Interesting, but I am practically sure I didn't do neither of them - perhaps was a background update process?
us flag
It may be, in case automatic background updates (Unattended Upgrades) are turned on.
Manuel Jordan avatar
kz flag
If you can share an official source about this situation - consider to include in your answer
N0rbert avatar
zw flag
For *official source* check the logs at `/var/log/apt/`, `/var/log/unattended-upgrades/` and `/var/log/dpkg.log`.
Manuel Jordan avatar
kz flag
@N0rbert I mean about Ubuntu's Reference Documentation. But thanks for the paths!
Score:0
kp flag
sudo apt-get install -y surfshark

Got this error: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

sudo dpkg --configure -a

when run this command. Got this error: dpkg: error: parsing file '/var/lib/dpkg/updates/0078' near line 0: newline in field name '#padding'

cd /var/lib/dpkg/updates/0078
rm -rf 0078

After that i will remove this file.

sudo apt-get install -y surfshark

Again Got this error : E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

sudo dpkg --configure -a

It will configure dpkg

After All My Error is solved
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.