Updating git to latest version in side linux virutal machine rhel 9.2

Varma 1,275 Reputation points
2024-05-23T10:32:21.12+00:00

I have used command sudo dnf update on linux rhel 9.2 virtual machine to udpate git to latest version.

current version is 2.39.3

after executing sudo dnf update also git is not updating. Please suggest

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,586 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 35,636 Reputation points Microsoft Employee
    2024-05-23T17:31:56.7066667+00:00

    @Varma

    I installed RHEL 9.2 from the Azure Marketplace and installed git from dnf. I found that the latest git package available in the default repositories is git version 2.39.3. Since you already have git installed you can clone the latest repository and install it. These steps worked for me. You could also download the version you wanted and install it in a similar way.

    sudo su
    dnf install -y wget unzip tar make gcc openssl-devel libcurl-devel expat-devel zlib-devel
    git clone https://github.com/git/git
    cd git
    make
    make install
    exec bash
    git --version
    

    Hope this helps! Let me know if you have any questions.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A! User's image