Skip to content

Instantly share code, notes, and snippets.

@YuMS
Created June 29, 2016 09:28
Show Gist options
  • Save YuMS/6d7639480b17523f6f01490f285da509 to your computer and use it in GitHub Desktop.
Save YuMS/6d7639480b17523f6f01490f285da509 to your computer and use it in GitHub Desktop.
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@Ellen-Tuane
Copy link

many thanks!

@ernestojr
Copy link

tky

@sixvxsh
Copy link

sixvxsh commented Dec 14, 2022

working well. good job

@elmamerbro
Copy link

After 6 years, still working properly, Thanks!!!

@faustoroger
Copy link

Thanks!!

@vitorisaiainv
Copy link

Thanks! I needed this for ubuntu 18.04

@AnTienHuang
Copy link

Works like a charm, thanks!

@mineironovale
Copy link

Already done ✔️ Tks!

@SergeiBeltran
Copy link

Just what I was looking for. Thanks!

@DevaraatJoshi23
Copy link

Thanks. Still working smoothly after 7 years.

@makssof
Copy link

makssof commented Apr 14, 2023

WSL 2, Ubuntu 18.04, 04.2023
Still working, thanks.

@indSantosh
Copy link

Tried to run on Ubuntu 16.4 but getting below message,
The following packages have unmet dependencies: git : Depends: libpcre2-8-0 but it is not going to be installed Depends: git-man (> 1:2.41.0) but 1:2.7.4-0ubuntu1.9 is to be installed google-chrome-stable : Depends: libu2f-udev but it is not installable Depends: libvulkan1 but it is not going to be installed zoom : Depends: libxcb-xinerama0 but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

@naiyoma
Copy link

naiyoma commented Jun 29, 2023

works well

@brunxav
Copy link

brunxav commented Jul 7, 2023

Thank you very much!

@purvesh0110
Copy link

Thank you

@higornabuco
Copy link

Thank you!!!

@israelcena
Copy link

Oh Thanks!

@sidofdountio
Copy link

Thanks you

@esradev
Copy link

esradev commented Dec 15, 2023

Thanks

@promahbubul
Copy link

Thank you. This is Worked

@hamadecd
Copy link

Thank you! Work on Lubuntu 22.04

@sdr2002
Copy link

sdr2002 commented Jan 29, 2024

I am quite new to using Linux and I came across these commands while searching for "updating git ubuntu". Now I want to know exactly what these lines do? espicially this one -> sudo add-apt-repository -y ppa:git-core/ppa this probably updates everything in the repository (sudo apt-get update) [correct me if I am wrong pretty please] sudo apt-get install git -y (not sure what the -y flag does here)


Local Ubuntu adds (= subscribe or register the link of) the external repository as a library of packages it can (automatically) download and list up latest version for further updates.

You are adding the repository that contains the git package to your local ubuntu machine to do this subscription.
Now then, you do apt-get update, then you get the news that the git in that repo has the new version.
Lastly, you download it with apt-get install git.

@minato-unibot
Copy link

Thank you.

@martinfaraz7
Copy link

thanks.

@Sierra-034
Copy link

Thanks man!!

@DevPacho
Copy link

DevPacho commented Apr 1, 2024

Still works! Thanks

@etherblitzdev
Copy link

Works like a charm :-)

git --version
git version 2.43.2

even with prior installed:

gh version
gh version 2.46.0 (2024-03-20)

@under-script
Copy link

Thaks, from me, too!

@pheasa-dev
Copy link

Thank you for your sharing !!

@cristianjs19
Copy link

cristianjs19 commented Apr 21, 2024

Working! ❤️️
git --version
git version 2.43.2
Ubuntu 20.04 focal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment