I know this is a risky action. but I’m trying to resuscitate a very broken Squeeze system on which dpkg has repeatedly hung in update_initramfs. After several failed attempts to sort this out, I had to crash the terminal that dpkg was running in (Ctrl/C couldn’t break the hang). Now I can’t even start dpkg because the lock is set, and the system is potentially unbootable, which leads to being stuck between a rock and a hard place. Fortunately I haven’t had to reboot, so I’ve time to get the system sorted (hopefully).
Adel Moin [ Editor ]
Better to stop processes using it…
ps -aef |grep apt
ps -aef |grep dpkg
These will show you the processes (One of the outputs of both is grep process)
Then you can use kill command, to kill those.