How can I make a rpm from a spec file that can be installed on any host? Currently I have a spec file but when installing the rpm on other hosts I get this:

package my_software-1.0-1dist is for a different operating system

The files in the rpm are just perl programs so if the system has perl and some modules which are already spelled out on requires lines I shouldn't need to check the os. I already have BuildArch: noarch in my RPM.


Technically you can't. The OS the package was built for is encoded as part of the RPM header and there's no way to specify "any" as an OS. You can change %_os to another OS when building, but there's no generic value.

$ rpm -q --qf '%{os}\n' setup
  • Although "you can't" is definitely an answer im disappointed RPM doesnt provide for this. I'll wait for a while to see if anyone else responds before accepting this answer. – bot403 Oct 6 '11 at 22:58

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.