Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in git install from source on Ubuntu

Tags:

git

bash

ubuntu

I had git previously installed using ubuntu apt-get installed. Recently uninstalled it and installed git from source to get version 1.8.4 .

However now whenever I open a new termial on Ubuntu, I get the following error:

-bash: /usr/lib/git-core/git-sh-prompt: No such file or directory

I have tried to search various bash start files like .bashrc , .bash_profile or .profile, but can't find any reference to any git based setup.

How can I remove this error. I do not have /usr/lib/git_core folder, but do have /usr/libexec/git-core folder.

like image 253
jethar Avatar asked Aug 26 '13 19:08

jethar


3 Answers

Purging the git packages solves the problem:

sudo apt-get purge git

Gives:

$ sudo apt-get purge git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  git*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? 
(Reading database ... 103069 files and directories currently installed.)
Removing git ...
Purging configuration files for git ...
like image 121
user2726435 Avatar answered Nov 14 '22 12:11

user2726435


There is a file git* in the directory /etc/bash_completion.d which tried to access /usr/lib/git-core/git-sh-prompt, maybe from the previous installation.

Try to delete git* and then reinstall again from source

rm -rf /etc/bash_completion.d/git
like image 33
Christos Papoulas Avatar answered Nov 14 '22 13:11

Christos Papoulas


Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726669
Ubuntu: https://bugs.launchpad.net/ubuntu/+source/git/+bug/1196510
Mint:   forums.linuxmint.com/viewtopic.php?f=47&t=135218

You should be able to comment ". /usr/lib/git-core/git-sh-prompt" out of /etc/bash_completion.d/git-prompt or do what Debian Jessie has done and check whether the file exists or not.

The following the is /etc/bash_completion.d/git-prompt in its entirety from Jessie:

# In git versions < 1.7.12, this shell library was part of the
# git completion script.
#
# Some users rely on the __git_ps1 function becoming available
# when bash-completion is loaded.  Continue to load this library
# at bash-completion startup for now, to ease the transition to a
# world order where the prompt function is requested separately.
#
if [[ -e /usr/lib/git-core/git-sh-prompt ]]; then
        . /usr/lib/git-core/git-sh-prompt
fi
like image 22
user60080 Avatar answered Nov 14 '22 14:11

user60080