I was trying to install mono using following commands,
sudo apt-get install mono-*
unfortunately, I closed the terminal while it instal
run the command sudo dpkg --configure -a
next time please don't use
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
or anything like that. Decent way to do this is
sudo killall apt-get
After searching a lot I got a satisfactory result:
I found some places saying to run commands:
sudo apt-get install -f
sudo dpkg --configure -a
But none of those above worked.
The solution that worked to me:
sudo dpkg --configure --pending
I hope this helps
This error occurs when u stop the any installation in-between either using terminal or Ubuntu app center. This can be solved by removing the broken installation. To do so enter the following command in the terminal in the same order.
cd /var/lib/dpkg/updates
sudo rm *
sudo apt-get update
you can also try to update your ubuntu by command :
sudo apt-get update && sudo apt-get upgrade
Sometime the dpkg needs some update to fix this problem.