I am in the process of migrating from Subversion to Git for all of my projects and needed a way to install the latest version of Git in Ubuntu. There are many excellent resources that I have combined in this howto. I will be installing Git from Launchpad.
The first step in installing the latest version of Git is to tell apt where and how to get Git. These instructions are for Ubuntu Hardy Heron 8.04 LTS and will also work on later versions. Note that since Ubuntu 9.10 you can use the "sudo add-apt-repository" method to add the latest version of Git to Ubuntu. Create "/etc/apt/sources.list.d/git.ppa.list" and add the following lines (note that you can skip the deb-src if you do not need the Git source):
deb http://ppa.launchpad.net/smartlounge/ppa/ubuntu hardy main
deb-src http://ppa.launchpad.net/smartlounge/ppa/ubuntu hardy main
To use this approach to install the latest Git for other versions of
Ubuntu simply change "hardy" to the appropriate name (eg: lucid,
karmic, jaunty, or intrepid).deb-src http://ppa.launchpad.net/smartlounge/ppa/ubuntu hardy main
Note that if you were to run "sudo apt-get update" you will get the following error:
W: GPG error: http://ppa.launchpad.net
hardy Release: The following signatures couldn't be verified because
the public key is not available: NO_PUBKEY 0E76E800643C34E6
W: You may want to run apt-get update to correct these problems
To remove this message Ubuntu must be told that the package repository can be trusted. Go to the Launchpad PPA for Smartlounge
and click on the "Technical details about this PPA". Note the signing
key; in this case it is listed as "1024R/643C34E6". Copy the last part
of the key and run the following command:W: You may want to run apt-get update to correct these problems
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 643C34E6
You should see the following message:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring
--secret-keyring /etc/apt/secring.gpg --trustdb-name
/etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver
keyserver.ubuntu.com --recv-keys 643C34E6
gpg: requesting key 643C34E6 from hkp server keyserver.ubuntu.com
gpg: key 643C34E6: public key "Launchpad PPA for Smartlounge" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
And now you can install the latest version of Git for Ubuntu:gpg: requesting key 643C34E6 from hkp server keyserver.ubuntu.com
gpg: key 643C34E6: public key "Launchpad PPA for Smartlounge" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
sudo apt-get update
sudo apt-get install git-core
Launchpad PPA for Smartlounge also maintains the following packages:sudo apt-get install git-core
- hamster-applet
- kdiff3
- kla
- qgit
- smlscripts-addon
Thanks!
ReplyDelete