Update Git In Ubuntu To Latest Version
December 10, 2024I was trying to push a repository to gitlab and it was very slow. I thought maybe updating the git version would help.
The current version of git is git version 2.25.1
Updating git
I tried following the instructions from this stackoverflow answer ↗️ but fails during sudo add-apt-repository ppa:git-core/ppa
.
I then stumbled upon this code from this github comment ↗️
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EXPKEYSIG 23F3D4EA75716059
I tried the said command while replacing the key found from my error message.
Tried running the add-apt-repository
command again and return the same error.
I revised the key in the apt-key
command and tried the add apt repository again which still resulted to the same error.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 23F3D4EA75716059
Scrolling down from the previous github answer I tried out adding the port 80
as stated on this github command ↗️.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 23F3D4EA75716059
This still failed.
Removing the apt repository
Following this stackoverflow answer ↗️
Install ppa-purge
.
sudo apt-get install ppa-purge
List out the repositories and find “github”.
grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep github
Attempted to remove the listed repository but still result to the same signature verification error.
sudo ppa-purge -s cli.github.com ppa:packages
The conclusion
sudo rm /etc/apt/sources.list.d/github-cli.list
Found it from this github issue ↗️.
Followed the same commands to update git and it finally succeeded.
sudo add-apt-repository ppa:git-core/ppasudo apt-get updatesudo apt-get install git
And pushing to gitlab is still slow 🙃