Dpkg Was Interrupted, You Must Manually Run 'dpkg --configure -a' To Correct The Problem -

sudo rm /var/lib/dpkg/lock-frontend sudo rm /var/lib/dpkg/lock sudo dpkg --configure -a If dpkg --configure -a keeps failing on the same package (e.g., grub-pc or linux-image ), try purging its configuration and reinstalling:

sudo apt install -f This second command fixes any broken dependencies left behind. Once it returns to the command prompt, run:

If nothing else is open, force-remove the stale lock file (only if you're sure no package manager is running): grub-pc or linux-image )

sudo dpkg --configure -a It tells dpkg to go back and finish configuring any partially installed packages. Once it returns to the command prompt, run:

Have you ever tried to install something on Ubuntu or Debian using apt install , only to be greeted by this wall of red text?

Once it returns to the command prompt, run:

E: Could not get lock /var/lib/dpkg/lock-frontend Another package manager is running. Close the Software Center, Synaptic, or other terminal windows. Then try again.