sudo dpkg --configure dpkgIt will return an error, but your db will be unlocked and you can get on with life.
Tidbits about how to do things so that I won't forget. Some might even be useful to other folks, who knows? Topics: Linux, svn, php, shell scripting... and whatever else is in the tags
sudo dpkg --configure dpkg