Centos – Installed software from source, how to say yum not to install it from package

centospackage-managementyum

On a CentOS 7, I've installed foobar version 2, compiled from sources.

How can I make yum aware of that install so it won't install foobar version 1 for dependency?


Installation of foobar

$ git clone https://example.com/foobar.git
[...]
$ cd foobar
$ make && sudo make install
[...]
$ foobar --version
foobar v2

Installation of a package requiring foobar

$ sudo yum install baz
[...]
---> Package baz.x86_64 0:3.14.15-9 will be installed
--> Processing Dependency: foobar >= 1 for package: baz-3.14.15-9.x86_64
[...]
Dependencies Resolved

==============================================================
 Package           Arch      Version      Repository   Size
==============================================================
Installing:                  
 baz               x86_64    3.14.15-9    example      1.1 M
Installing for dependencies: 
 foobar            x86_64    1.0.0-0.el7  example      4.5 M

I'd like yum to know foobar 2 is installed and since baz requires foobar >= 1 or simply foobar, foobar-1.0.0-0.el7.x86_64.rpm should not be installed.

Best Answer

"I've installed foobar version 2, compiled from sources"

Take the extra effort when adding custom software to your system and package your additions in a RPM. See Martin Streicher, 2010-01-12, Building and distributing packages, IBM on how to do that.

Then install that resulting RPM so it can and will play nice with your package manager's conflict and dependency handling, upgrade, downgrade and removal procedures and security reporting.