Using yum to local install without checking repository

To prevent yum from going online and check with the repositories, you will need to include --disablerepo flag. For example:
 
yum localinstall --disablerepo=* gcc-4.1.2-48.el5.x86_64.rpm --nogpgcheck