简体   繁体   中英

How to install git 1.8 or above on Debian Wheezy

I'm trying trying to install a later version of git (primarily 1.8.* or above). if I try and install it using apt-get install git I end up installing version 1.7.10.4 .

I have already tried changing the repository using the method below:

add-apt-repository ppa:git-core/ppa
apt-get update
apt-get install git

The output of apt-get update just gives the me the following and because of that, I end up installing version 1.7.10.4 again.

W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/source/Sources  404  Not Found
W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/binary-amd64/Packages  404  Not Found

I have also tried to install git using a backport, like the following:

sudo apt-get install git/wheezy-backports
sudo apt-get -t wheezy-backports install git

I never end up getting further than apt-get install git/wheezy-backports because then I end up getting the following error:

E: Release 'wheezy-backports' for 'git' was not found

How would I install git 1.8.* or above on Debian Wheezy?

I would definitely recommend using the backports version. To use the backports repository, keep in mind that you must add the following line to your /etc/apt/sources.list:

deb http://http.debian.net/debian wheezy-backports main

And then you can retry with apt-get. You will find full instructions at http://backports.debian.org/Instructions/#index2h2

Let me provide a clean copy/paste solution:

echo "deb http://http.debian.net/debian wheezy-backports main" >/etc/apt/sources.list.d/wheezy-backports.list
sudo apt-get update -qq
sudo apt-get -t wheezy-backports install -y -qq git mercurial

Clone it from its repo https://github.com/git/git and compile it yourself. I've done it on Cygwin and it was easy, so it should be OK on Debian. Read the INSTALL file, it is fairly self-explanatory.

If you haven't compiled software before you should know that there will be quite a few pre-requisites required (they are listed in the INSTALL). You should just be able to apt-get them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM