strace -f -o /tmp/strace.log apt-get install whatever
less /tmp/strace.logand search of the package name from the end
- If the problem is with post-installation script, you will find some errors around
- Edit it and inspect why it can/can't start/stop service (for example)
Particularly in the last case /var/lib/dpkg/info/snmpd.postinst called
which hung. All script returned code error much higher then 0 :-)
How to fix it is another story.