skip to Main Content

I want to install Git on Debian 9.
I ran apt install git-all as it says on Git site but it installed version 2.11.0.

I thought that there was a need for packages update, but apt-get update and apt-get upgrade didn’t change anything. It appears that this Git version is the latest stable for Debian 9.

I want to use a more recent Git version. What is the best I can do?

2

Answers


  1. Chosen as BEST ANSWER

    In order to run the latest Git version, I followed the instructions on Installing from Source on the official Git site.


  2. Maybe a backports version for the Debian release you are using provides a more recent git version which satisfies your requirements.

    Taking the Debian 11 (bullseye) release as an example, bullseye‘s default git package is on version 2.30.x, whereas bullseye-backport‘s git is on version 2.34.x. This more recent git version is especially desirable as it allows to sign commits with SSH keys.

    First you need to add the bullseye-backports package source to your bullseye system (I don’t know if e.g. the older stretch would allow to use bullseye-backports), then after an apt update, you will be able to install the backports git package:

    echo "deb http://deb.debian.org/debian bullseye-backports main" >/etc/apt/sources.list.d/bullseye-backports.list
    
    apt update
    apt install git/bullseye-backports
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search