在全新的Ubuntu 13.10版本中将git降级到1.7.x系列的最佳方法是什么?
我正试图为此找到一些ppa,但我没有看到任何。
答案 0 :(得分:7)
首先从具有Git 1.7的Ubuntu版本安装git
包 - 比如12.04 LTS(精确)。 download these manually并使用dpkg
(更简单的选项)安装它们,或者(如果您还需要精确的许多其他包)将精确的包存储库添加到/etc/apt/sources.list.d/
并使用它们安装它们apt-get
:
echo 'deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse' | sudo tee /etc/apt/sources.list.d/precise
sudo apt-get update
sudo apt-get -t precise install git
成功完成后,pin or hold apt
中的git包以防止它们被更新。 Pinning是传统的解决方案(我已经在Debian或Ubuntu上使用了多年) - 请参阅链接的howto以获取更多相关信息。持有是更新的方法,看起来更简单/更容易:
sudo apt-mark hold git
答案 1 :(得分:4)
删除当前版本:
sudo apt-get remove git-core git-svn git-email
安装libcurl3-dev,asciidoc,autoconf和xmlto:
sudo apt-get install libcurl3-dev asciidoc xmlto autoconf
下载tarball并提取其内容:
tar -xvzf git_x.y.z.tgz
输入git目录:
cd git
编译并安装:
make configure
./configure --prefix=/usr
make all doc
sudo make install install-doc
答案 2 :(得分:1)
运行旧版本可能是一个坏主意,但如果您真的想这样做,则必须从源代码安装它。
只需download the source code for the version of your choice,删除现有的git包apt-get remove git
,然后从源代码手动编译git。您可以查看INSTALL file for full instructions,但基本上,请确保您已经从apt-get获得了build-essential,然后make; make install