Of late I've been noticing lots of dpkg cannot get lock to directory looping errors. One way to produce this is with aptitude install emacs planner-el. Probably many other emacs add-ons also produce this error as well. I first noticed this happen when I tried aptitude install emacs bsdgames. Emacs got on fine but bsdgames did not. If I tried aptitude install bsdgames emacs though, bsdgames gets on fine but blocks emacs.