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:

  1. You can still do yum remove git and it will remove git 2.10 (same file locations).
  2. If you try to make yum install X where X 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!

1
  • 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 via yum which installs everything in default system folders.
    – Celdor
    Commented May 11, 2017 at 21:36

1 Answer 1

0

I would uninstall git package after compilation (traditionally that step is executed with make command, but looking into Git guide you have mentioned it uses make all doc info), but before installation with sudo make install install-doc install-html install-info (or similar command for the software in question which installs what was compiled). Or simply just reran the installation command after dnf remove git.

Hopefully I'm not missing anything in your question.

Also one world of warning: you need to be sure you really know what you are doing - you are basically ignoring your distro's timely updates (e.g. for security reasons) this way (adding this because you have mentioned e.g. php which might be often attack vector.

1
  • I do not know details of what you are describing, but that seems to be regular bug to the package. Generally depends on how much time you have to administer one system, if you have correct processes for it in place and so. If you are able to maintain self-compiled software with same reliability as your OS vendor and if you have same or bigger insight into what you are doing, then you are OK.
    – jhutar
    Commented Nov 1, 2018 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .