RPM – How to Install GCC from CentOS Distribution Media

centoslinuxrpmyum

I have a few package installation related questions concerning RPM, YUM and CentOS and getting GCC installed:

  1. I've mounted my distribution media on my CentOS 5.2 machine but I can't seem to work out how to point RPM at the media and use that instead of looking to the internet. All the examples I've googled for appear to assume downloading the RPM's from the internet.

  2. What does the -ivh switch combo do (I'm guessing -i is for install)? I did man rpm but the switch count and combinations blew my mind.

  3. Should I be using YUM instead of RPM?

Best Answer

I'd recommend using yum localinstall rather than using the rpm command directly; that way you'll have the gcc package in your yum database so that it can keep track of updates. The command would just be:

yum localinstall /mnt/cdrom/CentOS/gcc-(whatever).rpm