Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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
share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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