0

I have a CentOS 7 system. It has git 2.27.0 installed, but that install, for reasons we can't figure out, won't talk to our https gitlab instance. It keeps failing on "unable to find remote helper for 'https'".

So, I attempted to upgrade git, using 'sudo yum upgrade git', which claims there's no git package installed. But if I do a 'git --version', I get "git version 2.27.0". A "whereis git" gives me "git: /usr/local/bin/git". If I do a 'sudo yum remove git', I get "No match for argument: git, No Packages marked for removal".

I've tried installing git, which works, after a fashion. As in, a new git instance is installed on my system; I get lots of messages that the install worked fine and git 2.31.1 was installed. But if I do git version, I get again get 2.27.0. If I then remove git again, it removes my 2.31.1 version, and keeps the 2.27.0. But, again, yum claims it's not really there. The $PATH has /usr/local/bin before /usr/bin. I assume it's installing the newer copy in /usr/bin, then completely ignoring the copy already in /usr/local/bin.

So, is there a way to tell yum to remove the copy at /usr/local/bin? Because when I try to do 'sudo yum remove /usr/local/bin/git' I get "No match for argument: /usr/local/bin/git".

1 Answers1

2

The fact that git is in the folder /usr/local/bin suggests that it had not been installed via the system package management.

Maybe it has been compiled from source, maybe it was installed differently, there is no way to know.

If it has been compiled and installed from source, AND the source code is still on the system, you might be able to remove it using make uninstall in the source folder.

If not you will have to delete every file that belongs to that git install manually (or at least the git binary and ignore that you have more orphaned files on your system). Your best chance is to ask whomever installed it.

You could just install git with the package manager. It should supersede the older installation, or you should be able to make it the "primary" by adjusting the order of the bin directories in the path variable.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
  • I did install git through yum, but either the new version of git also didn't know what to do with https, or more likely my calls to git were still going through the old version. I do know who built these instances, but I asked them about it first! So far they're mum. Thanks for your detailed answer, I'm running by others in my group now to see if they have a preference. – user3224303 Jul 30 '21 at 20:42