Wednesday, November 3, 2021

[SOLVED] RPM dependencies

Issue

I'm building my own RPM and I want to specify a specific version of the node.js package as dependency.

I've tried several way to specify it in the .spec file but none of theses works, how should I write it ?

I have tried :

BuildRequires: nodejs.x86_64 = 2:10.5.0-1nodesource

also

BuildRequires: nodejs = 10.5.0

also

BuildRequires: node = 10.5.0

Get the following error building the rpm :

error: Failed build dependencies: nodejs.x86_64 = 2:10.5.0-1nodesource is needed by ...


My building machine is a Centos 7

enter image description here


Solution

BuildRequires: nodejs = 2:10.5.0-1nodesource

The full version in necessary on the right-hand-side, but specifying .x86_64 on the left-hand-side was the problem with the first attempt.

You should probably not be specifying the arch, but if you must, it can generally be done like this:

BuildRequires: nodejs(x86-64) = 2:10.5.0-1nodesource



Answered By - whydoubt