无法在 Ubuntu 上安装 Git 核心库
根据 Scott Chacon 的 Pro Git 书籍第 9 页,要在 Ubuntu 上安装 Git,我们需要有 Git 依赖的库:curl、zlib、openssl 、expat 和 libioconv。因此,我输入
$ sudo apt-get install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
并收到错误消息
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package curl-devel
那么有人遇到过这个问题吗?
我使用的是 Ubuntu 10.04 LTS,我尝试安装的 Git 版本是 git-1.7.3。
谢谢。
Based on the Pro Git book by Scott Chacon on page 9, to install Git on Ubuntu we need to have libraries that Git depends on: curl, zlib, openssl, expat, and libioconv. Thus, I type
$ sudo apt-get install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
and I got the error message
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package curl-devel
So has anyone ever met this issue?
I'm using Ubuntu 10.04 LTS, and the Git version I'm trying to install is git-1.7.3.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过
sudo apt-get install git-core
?包管理器旨在为您解决依赖关系,因此您无需手动执行此操作。诚然,lucid 软件包存储库中的 Git 版本是 1.7.0,但除非您确实需要最新版本,否则使用您的版本支持的版本可能会更简单(或者在安装支持的版本)。apt
会去这里为您找到列出的依赖项,并提示您让它自动安装它们。Have you tried simply
sudo apt-get install git-core
? Package managers are designed to resolve dependencies for you, so that you don't have to do it manually. Granted, the version of Git that's in the lucid package repository is 1.7.0, but unless you really need the very latest version, it may be much simpler to just go with the one supported for your release (or update Git later after installing the supported version).apt
would go and find the dependencies listed here for you, and prompt you to have it automatically install them as well.您可能需要
libcurl-dev
,但如果您只需要 版本的 git,git-core
应该没问题。如果您想构建 git 源 tarball apt-get build-dep git-core 应该安装您需要的所有开发包。
You probably want
libcurl-dev
, though if you just need a version of git,git-core
should be fine.If you want to build a git source tarball
apt-get build-dep git-core
should install all the development packages you need.您可以直接在 ubuntu 上安装 git,只需:
这将为您处理所有依赖项。
如果你确实想从源代码构建它,请运行:
这将为你检索构建 git 所需的所有依赖项(至少是 ubuntu 中可用的 git 版本)。
You can install git directly on ubuntu with simply:
This will take care of all dependencies for you.
If you really want to build it from source, run:
This will retrieve all dependencies needed to build git (at least, the version of git available in ubuntu) for you.