embedded-linuxrpmrpmbuildrpm-specrpm-maven-plugin

rpm package installation issue with nodeps flag


I am trying to install an rpm package using the command as under:

rpm -Uvh --root=/mnt/bank_a rpm/app_name.rpm --nodeps

It is an application package which is part of root filesystem installation for a mounted device under linux hence the root flag is essential to specify the install path.

--prefix can not be used since it is a non relocatable package. The nodeps flag is used to suppress the error below(sh exists as a soft link to bash under /bin folder ):

Failed dependencies: /bin/sh is needed by xxx

But the pre scriplet fails for me with below error

error: %pre(app_name.rpm) scriptlet failed, exit status 255 error: install: %pre scriptlet failed (2), skipping app_name.rpm

I do not understand why --root and --nodeps won't work together or what is the right thing to do here.


Solution

  • The right thing to do at this point is not use RPM. By messing with the root, and then saying "I don't care about dependencies," you're in no man's land. The scripts are trying to do things they cannot, and you're not providing enough information to actually tell you what's wrong.

    The easiest solution is to go to a temporary directory and runrpm2cpio your.rpm | cpio -div and then copy the resulting file tree where it needs to be installed.

    So I'm not accused of not answering the actual question, you can do --noscripts, but then you'll be here tomorrow asking why the program didn't work when you didn't use the support infrastructure that is RPMs to get it done in the first place.