Ошибка при установке git из источника в Ubuntu

Ранее у меня был установлен git с использованием ubuntu apt-get. Недавно удалил его и установил git из исходного кода, чтобы получить версию 1.8.4.

Однако теперь, когда я открываю новый терминал в Ubuntu, я получаю следующую ошибку:

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

Я пытался выполнить поиск в различных начальных файлах bash, таких как .bashrc, .bash_profile или .profile, но не могу найти никаких ссылок на какие-либо настройки на основе git.

Как мне убрать эту ошибку. У меня нет папки / usr / lib / git_core, но есть папка / usr / libexec / git-core.


person jethar    schedule 26.08.2013    source источник
comment
/usr/libexec/git-core - это остаток от установки dpkg или он был создан из вашей исходной установки? если второе, то почему вы не установили git в /usr/local ??   -  person umläute    schedule 26.08.2013


Ответы (3)


В каталоге /etc/bash_completion.d есть файл git*, который пытался получить доступ /usr/lib/git-core/git-sh-prompt, возможно, из предыдущей установки.

Попробуйте удалить git*, а затем заново установить из источника

rm -rf /etc/bash_completion.d/git
person Christos Papoulas    schedule 26.08.2013
comment
Да, это есть, спасибо. Разве я не могу просто удалить этот файл без переустановки из исходников, поскольку я уже установил. В качестве альтернативы, могу я просто запустить команду make install. - person jethar; 27.08.2013

Очистка пакетов 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 ...
person user2726435    schedule 28.08.2013

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
person user60080    schedule 11.02.2014