How can I update to a newer version of Git using apt-get?
I've just set up a new machine with Ubuntu Oneiric 11.10 and then run
apt-get update apt-get upgrade apt-get install git
Now if I run
git --versionit tells me I have
git version 126.96.36.199but on my local machine I have the much newer
git version 188.8.131.52
I know I can install from source to get the newest version, but I thought that it was a good idea to use the package manager as much as possible to keep everything standardized.
So is it possible to use
apt-getto get a newer version of
git, and what is the right way to do it?
You have several options:
- Either wait until the version you need is present in the repository you use.
- Compile your own version and create a
- Find a repository that provides the version you need for your version of your distribution(e.g. Git PPA).
- If you don't need any particular feature from the newer version, stay with the old one.
If a newer version is available in the repositories you use, then
apt-get update && apt-get upgrade(as root) updates to the latest available version.
For those who don't know what a PPA is, link
+1 for the PPA. Otherwise compile from source and use checkinstall to cleanly install a .deb