2
I'm using CentOS(7.2) and I need to compile some tools from source to get some new features on the server. I'm OK with compiling from source, but I have problem with yum. Let's take a look at the example with GIT.
If you try to yum install git
you will get GIT 1.8.3.1. I need newer version, for instance 2.10. I'm following tutorial from git page https://git-scm.com/book/en/v2/Getting-Started-Installing-Git here.
If you install require tools to compile git, you will notice that one of the dependency is git itself. So just before the compilation of newer version, you actually have git installed. After compilation, desired version is available (2.10)
So everything is fine, but here are couple of issues that I'm facing. Let's say that there is newer version of GIT in CentOS repository. So after yum update git
my compiled version will be replaced by, let's say 1.9. I would like to prevent such situation.
My first thought was to add exclude git*
to yum.conf
and it would solve issues with update, but it has two drawbacks:
- You can still do
yum remove git
and it will remove git 2.10 (same file locations). - If you try to make
yum install X
whereX
has git as dependency, you won't be able to install it:/
The question - How to update yum with information about package compiled from source?
One thing I might be able to do is to build empty RPM for git and add it to yum. So yum will have an information about my compiled version. However I'm not sure if that is good solution?
I would like to get some input and ideas about that situation. Please, don't referee to GIT strictly, it can be any other package, like nginx or PHP.
Any help would be appreciated!
Why don't you just install git from sources into a separate folder, like
/opt/git
? If you do, you won't mess up with git installed viayum
which installs everything in default system folders. – Celdor – 2017-05-11T21:36:37.693