The reason for not invading Pakistan, Libya, Russia, and England is that the Governments themselves do not support terrorism. Even Gaddafi decided against supporting extremists after the U.S.A went to war with them.
The reasons that places like Iran have not been invaded are political as well...