2

For a while I have the problem mentioned in the title. Update is stuck on pre-configuring packages without any other error. I tried almost everything I've found searching Google, but it didn't solve my problem.

btw

sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update && sudo apt-get upgrade

is not working. Can somebody please help me fix this issue?

Peachy
  • 7,117
  • 10
  • 38
  • 46
Daniel
  • 21
  • 1
  • 3

3 Answers3

3

Open up top, press V to enable tree view, and find the leaf process under xenial -> xenial -> sh -> dpkg-preconfigre -> ... -> blocking leaf process. Then kill (softly) this process:

sudo kill -s SIGTERM {process_id}

In my case, it was grep waiting for something that clearly wasn't coming.

ostrokach
  • 854
  • 8
  • 11
  • This worked on my server too, however I'm curious whether this has any side affect. In my case it was grep too. May/Should I check for anything after upgrade completed? – Lashae Jun 24 '19 at 11:06
2

I noticed that a mysql process was starting every time I tried to upgrade and it was eating all of one of my processors. That same process stopped after I stopped the upgrade process. I was unable to determine the cause of that mysql process being stuck so I followed the advice from here: "Failed to spawn mysql main process: unable to execute: No such file or directory".

Then, after running apt-get upgrade it worked without a problem.

Hope this helps.

Stefan
  • 21
2
  1. Cleaning using two ways command. sudo apt-get clean && sudo apt-get update

  2. dpkg --configure -a

  3. apt-get install -f The last command will help you to remove all broken package.

  4. sudo apt-get update && sudo apt-get upgrade

  5. reboot pc

  6. Install the rest of the package through update-manager.

hope it helps

Erick
  • 31