
Welcome to this tutorial on how to install Git on Ubuntu 24.04. Git is a tool that helps you keep track of changes in your files and projects, making it easier to manage your work. It’s secure and widely used by many people to organize their code and projects. While Git often comes pre-installed on Ubuntu 24.04, you might need to install a specific version yourself. This guide will take you through installing Git on your Ubuntu hosting of choice in a few simple steps.
Table of Contents
Prerequisites:
- An Ubuntu 24.04 VPS
- At least 2GB of RAM
- SSH root access or a system user with sudo privileges
Step 1. Update System Packages
To start, log in to your Ubuntu 24.04 using SSH:
Replace ‘IP_Address’ and ‘Port_number’ with your server’s actual IP address and SSH port number. If needed, replace ‘root’ with the username of your sudo account.
Once logged in, you must make sure that all UbuntuOS packages installed on the server are up to date. You can do this by running the following commands:
Method 1: Install Git on Ubuntu 24.04 Using the Package Manager
Since Git is often pre-installed on Ubuntu 24.04, you should first check if it is already installed on your system by using the following command:
The above output indicates that Git is pre-installed. If it is not installed on your system, run the following command to install Git from the official repositories:
Method 2: Install Git on Ubuntu 24.04 From the Source
If you want to install a specific version of Git on Ubuntu, you can compile it from the source. To do this, you must first install the required libraries by running the following command:
Let’s download the source code for the latest Git version, which is 2.45.2. You can replace 2.45.2 with the version you want to install:
Output:
Next, extract the downloaded file using the following command:
After extracting, navigate to the Git installation folder and run the following commands:
Here’s how the output should look:
After the installation finishes, verify the Git version by using the following command:
For additional details about Git, its features, and configuration, refer to their official documentation.
Of course, you don’t have to install Git on Ubuntu 24.04 if you use one of our Fully-Managed Git Hosting services, in which case you can simply ask our expert Linux admins to install and configure Git on Ubuntu 24.04 for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post on installing Git on Ubuntu 24.04, please share it with your friends on social networks or simply leave a comment in the comments section. Thanks