I am trying to install php-fpm with sudo apt-get install php-fpm. When I do that commmand, it gives the error: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

When I type sudo dpkg --configure -a it says: Setting up mariadb-server-10.1 (1:10.1.44-0ubuntu0.18.04.1) ..., and takes forever. I have tried rebooting, but that does not do much.

I need to install php-fpm (and others), so i'm not really sure what to.

I have read these posts: and did what they all say, to no avail

sudo dpkg --configure -a

sudo dpkg --configure -a takes forever

sudo dpkg --configure -a error

  • Have you tried strace? sudo strace sudo dpkg --configure -a ... The solution could also be found with unpack the .deb archive, read the install script and do it step by step ... But strace will tell us where to search ... In your case I assume the script wants to stop the service ant maybe it is already stopped? Or the Service wait for the service to stop/halt and in the mariadb log are more information why it can't? ... But first we need the place where is waiting and for what. – LupusE Mar 13 '20 at 11:53
  • I ended up reseting the server, but thank you. If this happens again, I will try it – FredTheDoggy Mar 13 '20 at 13:01
  1. sudo dpkg --configure -a
  2. Ctrl + C
  3. Remove Mariadb or Uninstall Mariadb
  4. Install Mariadb

This way I solved My Problem.


If nothing works then:

  1. Backup Entire Server
  2. List all the Installed packages apt list --installed
  3. Reset Server/VM (Must be done manually, as there is no way to factory reset from the command line)
  4. Run the backup
  5. Re-install all packages, that were in step 2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.