Unable to update Git on Ubuntu

Posted on Aug 3, 2022

Question

I am trying to set up Git on an Ubuntu Machine (I'm using a Samsung Chromebook running Ubuntu 12.04).

When I entered "sudo apt-get install git" and it successfully installed Git 1.79

user@ChrUbuntu:~$ git --version
git version 1.7.9.5

I can't figure out what I am doing wrong here. Any suggestions?

Answer

For new installations of Ubuntu I would first try this to get the latest updates

sudo apt-get dist-upgrade

For more info on this see https://askubuntu.com/questions/81585/what-is-dist-upgrade-and-why-does-it-upgrade-more-than-upgrade

That should solve it but if not, add the repository from these guys https://launchpad.net/~git-core/+archive/ppa

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

This way you don't have to build it, etc.