I don't really know if there is a way to fix this issue... unless you had some sort of whitelist of acceptable packages, and a prompt if you try to install a non-whitelisted package.
One other possibility is to have a delay, so that it waits an amount of time before installing, to give a chance to catch and fix the typo.