2013-08-26 38 views
6

我曾經安裝過使用ubuntu apt-get安裝的git。 最近卸載它並從源代碼安裝git以獲得版本1.8.4。在Ubuntu上從源代碼安裝git的錯誤

但是現在,每當我打開一個新的termial在Ubuntu上,我得到以下錯誤:

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

我試圖尋找各種慶典開始喜歡的.bashrc文件的.bash_profile或.profile,但可以」 t找到任何參考任何基於git的設置。

如何消除此錯誤。我沒有/ usr/lib/git_core文件夾,但是有/ usr/libexec/git-core文件夾。

+0

是'在/ usr/libexec目錄/ GIT-core'從dpkg的安裝吃剩的或已將它從你的源 - 創建安裝?如果是後者,爲什麼你不把git安裝到'/ usr/local'? –

回答

3

目錄/etc/bash_completion.d中有一個文件git*,它試圖訪問/usr/lib/git-core/git-sh-prompt,可能來自以前的安裝。

嘗試刪除git*,然後從源

rm -rf /etc/bash_completion.d/git 
+0

是的,那裏,謝謝。我不能刪除這個文件,不需要重新安裝源代碼,因爲我已經安裝了。 ,我可以只運行'make install'。 – jethar

8

清除git的包重新安裝解決了這個問題:

sudo apt-get purge git 

給出:

$ 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 ... 
2
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 

你笑可以評論「。/usr/lib/git-core/git-sh-prompt「/etc/bash_completion.d/git-prompt或者執行Debian Jessie所做的操作,並檢查文件是否存在

以下在其全部從傑西/etc/bash_completion.d/git-prompt:

# 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