Install GIT on AlmaLinux 9 Quickly and Correctly
If you’re new to AlmaLinux or just want a fresh install, this short guide shows how to get Git up and running fast—no extra fluff, just the steps that matter.
Why use DNF instead of compiling from source?
AlmaLinux 9 ships with a clean DNF stack; pulling the package straight from the official repos guarantees it’s signed, built for your system, and receives security updates automatically. Trying to compile yourself adds needless maintenance work—and you’ll still end up chasing the same dependency headaches.
Step 1: Add the EPEL repository
EPEL (Extra Packages for Enterprise Linux) keeps the latest stable Git version.
sudo dnf install epel-release -y
This one‑liner installs the repo file and its GPG key, so DNF can verify packages from there.
Step 2: Install Git
With EPEL enabled, grab Git:
sudo dnf install git -y
The -y flag skips the confirmation prompt—useful if you’re scripting or just want to get on with it. The command pulls a pre‑compiled binary that’s already linked against the system libraries.
Step 3: Verify the installation
Run:
git --version
You should see something like git version 2.xx.x. If it reports an older release (e.g., 1.7), you’re still looking at the default stream from AlmaLinux’s base repo, not EPEL.
Common hiccup: old Git can choke on modern HTTPS
I’ve seen users clone a GitHub repo and hit fatal: unable to access … SSL certificate problem. That usually means their Git binary is too old to negotiate TLS 1.3 or newer ciphers. Installing the EPEL‑supplied version (step 2) fixes it instantly.
Optional: Pin the latest Git from COPR
If you need a bleeding‑edge build, enable the copr:copr.fedoraproject.org/epel-git repo:
sudo dnf install -y https://download.copr.fedorainfracloud.org/results/epel-git/almalinux-9-x86_64/epel-git-almalinux-9-x86_64-0.el9.noarch.rpm sudo dnf install git -y
The COPR package pulls the newest Git 2.42‑ish, but be aware it’s not as tightly vetted for AlmaLinux as the EPEL release.
Quick sanity check: clone a repo
mkdir demo && cd demo git init echo "Hello world" > hello.txt git add hello.txt git commit -m "Initial"
If that flows without errors, you’re good to go.
That’s it. Git is installed, verified, and ready for day‑to‑day use on AlmaLinux 9.