Fix install bugs

I cannot believe I let these bugs exist such long time! The appending of
the bashrc file of the dependencies should be done before installation
with each compiler set, and the cleaning of them should be done after
installation.

Also when user specifies packages to install in the command line, we
should only install them, not including the packages listed in the
configure file.