I have a few package installation related questions concerning RPM, YUM and CentOS and getting GCC installed:
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.
What does the
-ivh
switch combo do (I'm guessing -i is for install)? I didman rpm
but the switch count and combinations blew my mind.Should I be using YUM instead of RPM?
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:You want to use something like
rpm -ivh /mnt/cdrom/CentOS/gcc-(whatever).rpm
. The command line options there are:-i
-- install (you can use-U
to install or upgrade, many just always use that)-v
-- verbose output-h
-- show hashmarks, a simplistic progress barYum will figure out which package you mean if you type
yum install gcc
. That'll use your chosen repository, or the CD if you've got the correct repository installed (which you probably do). In general, yum is easier to use if you're not doing anything strange.There is probably already a repo defined in yum for the centos media that you can use that just needs to be enabled. The documentation included in the file shows you how you could disable all your remote repos, enable just the local media repo and install your software package from cd.
1 step rpm -ivh vsftpd.x86_64 0:2.2.2-7.rpm
2 step rpm -ivh createrepo-0.9.8-4.rpm
3 step copy every thing from DVD or .iso to /var/ftp/pub (cp -av /var/ftp/pub)
4 step createrepo -v /var/ftp/pub/
5 step vi /etc/yum.repos.d/base.repo
6 step
[base] name=Server Software baseurl=ftp://192.168.0.254/pub/ enabled=1 gpgcheck=0
7 step yum install gcc -y