sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock
sudo fuser -v /var/cache/debconf/config.dat
sudo kill
#check if it has been killed or/and appeared again than kill again.
(For instance: I have been using it many times when I have been upgrading from 12.04 to 12.10 quantal due to solve some hang ups of application upgrading (as well apt-get install -f or/and dpkg --configure -a))
I did following to solve it (many combination):
sudo rm /var/lib/dpkg/lock apt/archives/ lock debconf/ config. dat
sudo rm /var/cache/
sudo fuser -v /var/cache/
sudo kill
#check if it has been killed or/and appeared again than kill again.
(For instance: I have been using it many times when I have been upgrading from 12.04 to 12.10 quantal due to solve some hang ups of application upgrading (as well apt-get install -f or/and dpkg --configure -a))