This problem will arise when you accidentally kill the apt-get process or package manager not shutting down properly. So, dpkg become orphan process.
To solve this problem you can either restart your computer or open up the terminal and type in the following:
Code:
sudo rm /var/lib/dpkg/lock
Then:
Code:
sudo dpkg --configure -a