Install or upgrade Git on LinuxDownload a version of Git that is compatible with your version of Bitbucket from the Git website. If you are using a different Linux distribution, you may need to use a different package repository to get the latest stable version of Git. See the Git website.
The latest version is 2.33.0, which was released 12 months ago, on 2021-08-30.
The Ubuntu git maintainers team has a PPA just for that
ppa:git-core/ppa
Just do:
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
If add-apt-repository
command is not found, install it first with
sudo apt-get install software-properties-common python-software-properties
The question was: "What to do when sudo add-apt-repository ppa:git-core/ppa
command fails".
I had the same issue in a VM behind a proxy. I resolved it with the following two steps:
Set up proxy environment variables
export http_proxy=http://<user>:<pwd>@<proxy_url>:<port_number>
export https_proxy=http://<user>:<pwd>@<proxy_url>:<port_number>
Run the add-apt-repository
command again as sudo with the -E
option that preserves the user environment:
sudo -E add-apt-repository ppa:git-core/ppa
Just follow below commands to update latest version of git
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
git --version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With