Issue
I've produced an RPM which will be installed on air-gapped PCs (it will be distributed via CD and USB). It requires newer versions of some third-party packages than is currently installed on some of the machines.
I need this to be installable by end-users and I'd prefer not to give them instructions which list many RPMs they have to manually install in a specific order.
Is there any way I can put these third-paty RPMs in a subfolder on the CD/USB, and make this location visible to the dependency resolver? Could I create a local repo in the %pre step of my .spec file and remove it in %post?
Solution
You can't do what you're asking in %pre
and %post
, because (a) those are executed at install time which is well after dependency resolution and (b) you wouldn't be able to call rpm
to install things from your %pre
because the database is locked for the transaction you are part of.
When I've done something like this in the past, I have found the easiest thing to do is to put all the RPMs in a single directory on the media and instruct the deployment team to yum localinstall *rpm
from that directory. If some of the third-party RPMs are older than what is installed, it will just skip over them.
Answered By - Aaron D. Marasco Answer Checked By - Mary Flores (WPSolving Volunteer)