20

I think I used something involving dpkg but I am not able to recall what. After that when I need to do some

sudo-apt

get or even sudo-apt get update I am facing the following issue:

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

Any clue what is wrong and how can I fix this?

gm1
  • 311
  • 1
  • 2
  • 3

1 Answers1

20

It is called when packages are broken, or the package installation is interrupted.

You should run sudo dpkg --configure -a or its alternative apt-get -f install to solve this problem.

Olimjon
  • 6,982
  • 2
  • 25
  • 51
  • 1
    what does `sudo dpkg --configure -a` actually do? I see this command referenced multiple times but not sure what it actually does – red888 Dec 16 '17 at 19:40
  • @red888, In Ubuntu, packages are in a .deb file format, which is a zip file that holds compiled source ported into Ubuntu. By installing a package (`apt install ` or `dpkg -i `) it downloads then unpacks into `/` and finally configures the package. If package installation is interrupted by some circumstances in configuration phase then this problem occurs... – Olimjon Dec 23 '17 at 06:40
  • @red888, So `dpkg --configure -a` (Syntax: `dpkg` - package installer, `--configure` - start configuration phase, `-a` - all packages) starts the configuration phase again... Then, `apt-get -f install` resolves unmet dependencies as `apt-get` has an ability to automatically install, where `dpkg` can't... – Olimjon Dec 23 '17 at 06:50