If you've just reflashed you device, I would suggest doing so again. It might be a bit tricky to do anything with the normal app-man because rootsh is needed, and to install rootsh would probably need R & D mode. Have you tried disabling all your repositories and re-enabling them 1 by 1? Once you get things working again, I recommend you use Faster Application Manager (fapman) - it's a GUI for apt-get and often more reliable than the built-in app-man.