Stuck at "unpacking" while trying to install or remove a package

I tried to install a package, I forced it to stop then when I wanted to remove the package, it was stuck at "unpacking…"

Asked By: Chopin

  1. If you haven’t already, press CTRL+C to terminate. If it doesn’t work, do CTRL+Z and then the following:

    sudo pkill -9 apt

    sudo pkill -9 dpkg

  2. Now run the following command before proceeding to force-remove

    sudo dpkg --configure -a

  3. Force to remove the package

    sudo dpkg --purge --force-remove-reinstreq <name of your package>

  4. Make sure you still have space left on your device. It’s sometimes the reason why the installation is failing.

  5. Clean the cache and update APT

    sudo apt-get clean

    sudo apt-get update

Answered By: Chopin
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.