git - 在虚拟机上使用 Git 出现段错误

标签 git ubuntu segmentation-fault virtual-machine init

我刚刚创建了一个用于 Web 开发的 Ubuntu 虚拟机,我想使用 Git 进行版本控制,但是我遇到了一些问题。 [我之所以提到虚拟机,只是因为我以前在正常安装时从未遇到过这些问题。]

我使用 git init 初始化新的 Git 存储库,但立即收到以下错误:段错误

Git 似乎实际上初始化了存储库(通过创建相关文件),但是当我尝试 git statusgit add 时,我收到错误消息 fatal :不是 Git 存储库

任何对此问题的见解将不胜感激。

更新

这是@sehe 请求的信息:

一)

servace85@ubuntu:/var/www$uname -a
Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

servace85@ubuntu:/var/www$lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 11.04
Release:    11.04
Codename:   natty

b)

servace85@ubuntu:/var/www$dpkg --status git
Package: git
Status: install ok installed
Priority: optional
Section: vcs
Installed-Size: 10624
Maintainer: Ubuntu Developers <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="116473647f65643c757467747d3c75786272646262517d786265623f6473647f65643f727e7c" rel="noreferrer noopener nofollow">[email protected]</a>>
Architecture: amd64
Version: 1:1.7.4.1-3
Replaces: cogito (<< 0.16rc2-0), git-core (<< 1:1.7.0.4-1.), gitweb (<< 1:1.7.4~rc1)
Provides: git-completion, git-core
Depends: libc6 (>= 2.7), libcurl3-gnutls (>= 7.16.2-1), libexpat1 (>= 1.95.8), zlib1g (>= 1:1.2.0), perl-modules, liberror-perl, git-man (>> 1:1.7.4.1), git-man (<< 1:1.7.4.1-.), emacsen-common
Recommends: patch, less, rsync, ssh-client
Suggests: git-doc, git-el, git-arch, git-cvs, git-svn, git-email, git-daemon-run, git-gui, gitk, gitweb
Breaks: cogito (<= 0.18.2+), git-buildpackage (<< 0.4.38), gitosis (<< 0.2+20090917-7), gitpkg (<< 0.15), gitweb (<< 1:1.7.4~rc1), guilt (<< 0.33), qgit (<< 1.5.5), stgit (<< 0.15), stgit-contrib (<< 0.15)
Conflicts: git-core (<< 1:1.7.0.4-1.)
Conffiles:
 /etc/bash_completion.d/git 8f2975422e54845ec9aea549daa6050b
Description: fast, scalable, distributed revision control system
 Git is popular version control system designed to handle very large
 projects with speed and efficiency; it is used for many high profile
 open source projects, most notably the Linux kernel.
 .
 Git falls in the category of distributed source code management tools.
 Every Git working directory is a full-fledged repository with full
 revision tracking capabilities, not dependent on network access or a
 central server.
 .
 This package provides the git main components with minimal dependencies.
 Additional functionality, e.g. a graphical user interface and revision
 tree visualizer, tools for interoperating with other VCS's, or a web
 interface, is provided as separate git* packages.
Original-Maintainer: Gerrit Pape <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ef9f8e9f8aaf9c828e9d8b8a81c1809d88" rel="noreferrer noopener nofollow">[email protected]</a>>
Homepage: http://git-scm.com/

servace85@ubuntu:/var/www$ find /etc/apt -iname '*.list' | xargs cat | grep -v ^# | sort -u
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://extras.ubuntu.com/ubuntu natty main
deb http://security.ubuntu.com/ubuntu natty-security main restricted
deb http://security.ubuntu.com/ubuntu natty-security multiverse
deb http://security.ubuntu.com/ubuntu natty-security universe
deb http://us.archive.ubuntu.com/ubuntu/ natty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ natty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ natty universe
deb http://us.archive.ubuntu.com/ubuntu/ natty-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ natty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ natty-updates universe
deb-src http://extras.ubuntu.com/ubuntu natty main
deb-src http://security.ubuntu.com/ubuntu natty-security main restricted
deb-src http://security.ubuntu.com/ubuntu natty-security multiverse
deb-src http://security.ubuntu.com/ubuntu natty-security universe
deb-src http://us.archive.ubuntu.com/ubuntu/ natty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ natty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ natty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ natty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ natty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ natty-updates universe

c)

servace85@ubuntu:/var/www$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

servace85@ubuntu:/var/www$ echo $LD_LIBRARY_PATH


servace85@ubuntu:/var/www$ echo $LD_PRELOAD


servace85@ubuntu:/var/www$ which git
/usr/bin/git

servace85@ubuntu:/var/www$ file $(which git)
/usr/bin/git: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

servace85@ubuntu:/var/www$ ldd $(which git)
    linux-vdso.so.1 =>  (0x00007fff841ff000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1eee16e000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1eedf50000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1eedbbb000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1eee396000)

最佳答案

没有信息,我只能提供建议:

env -i git init # rule out environment issues?

# or pave over any installation problem:
sudo apt-get install --reinstall git

但是,更好的方法是提供更多信息:


(a) ubuntu 是什么版本

uname -a
lsb_release -a

(b) 什么包/存储库

dpkg --status git

// perhaps large:
find /etc/apt -iname '*.list' | xargs cat | grep -v ^# | sort -u

(c) 什么环境

echo $PATH
echo $LD_LIBRARY_PATH
echo $LD_PRELOAD
which git
file $(which git)
ldd $(which git)

关于git - 在虚拟机上使用 Git 出现段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6498804/

相关文章:

git - 错误 : git checkout-index: unable to create file

python - Ubuntu 18.04 上的 "E: Unable to locate package python-pip"

linux - 文件解压再压缩后md5不一样

git - 如何在 Git 上应用旧提交?

node.js - Bower 未从 Bower.json 安装

git - 无界 git 对分

mongodb - 如何从 tar.gz 文件安装 Robomongo 作为 Ubuntu 15.10 中的程序

C 链表段错误(核心转储)错误

c - 结构指针的段错误

c++ - 关闭二进制文件时出现段错误