2

I have inherited an ugly script for installing some code onto an old centos relesae, I'm trying to get the original script to work before upgrading to a proper RPM.

Currently the script is trying to install a number of RPMs in a directory, the install will go on a computer without internet access or yum repos. It was failing using rpm -ivh * because some of the RPMs were dependent on other RPMs in the same directory, and the rpm command would try to install them out of order.

I'm looking for the cleanest approach to do the install. I thought yum localinstall would work, but it first attempts to load the rpm from it's repos before using the RPMs in the directory, leading to a failure due to the lack of connectivity. I'm also not certain if it will appropriatly install the RPMs in order.

What is the cleanest approach for installation? I also believe I may need the --nogpgcheck argument?

  • How old is that old? I don't recall having problems with yum localinstall *.rpm on CentOS 5. (Also, you can/should set all the online repos in /etc/yum.repos.d to enabled=0 if the machine isn't online anyway.) – Ulrich Schwarz Apr 12 '17 at 15:41
  • @UlrichSchwarz centos 3, when I say old I mean old :P and I agree about changing the ym.repos, but again I don't know rather or not the ones maintaining the system will do it properly, at least one didn't... – dsollen Apr 12 '17 at 17:01
2

You could create a repository containing those RPMs. cd to the directory containing them, then run

createrepo .

next, add a .repo file to your /etc/yum.repos.d with a file:// URL to your directory.

You should now be able to install those packages with a "normal" yum install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.