How to Install Git on Ubuntu 17.04 Linux Operating System

October 21, 2019






Today in this tutorial will get to know how to install and configure Git on Ubuntu 17.04.

Nowadays, Git is the most famous version control system, as it supports distributed architecture and functionalities, we called it distributed version control system. It used by much more open source and commercial projects.

It has the functionalities to track the code changes, create branches, revert the project to previous stages, and collaborate with team members and your fellow developers.

Linus Torvalds was the first person who initiated the Git project and developed it; He is the person who creates the Linux Kernel also.

I have done all stuff on Ubuntu 17.04 what written in this article but hope it will also work on any Ubuntu System.


Before continue with below process to install Git, make sure your operating system is Ubuntu 17.04, and you have logged in as a user who is having sudo privileges.

Install Git with APT package Manager

The recommended and easiest way to install Git into the Ubuntu system is by using the native package manager (APT) from the default repository of Ubuntu Operating System.

This process will install the Git with the version available in the Ubuntu repository but if you want to install any other version or latest version of Git, follow the process of Installing Git from Source tutorial.

You can install Git into Ubuntu System using APT package by following steps:

Step 1- Update Ubuntu repository’s package index
Always update the repository package index before installing the new package in the system.
$ sudo apt-get update
$ sudo apt update
Step 2- Installing Git
Once the repository package list is get updated you can start Git installation by using the following command:
$ sudo apt-get install git
$ sudo apt install git
Step 3- Verify and check the installed version of Git
You can verify the new application installation by checking the version by running the command; here we are checking Git installed version using the following command:
$ git –version
git version 2.11.0

Now, Git version 2.11.0 successfully installed in your system; Now you can move into the Git configuration tutorial to complete your setup.

Install Git from Source

You can use Source installation for Git as another option of installation for Ubuntu Operating system. By using this installation, you can use the latest version or any version you like.

The only drawback of source installation is not being able to maintain using the APT package manager.

In the Linux operating system, when you use a package manager to install any application, it will install all required dependencies automatically, but when you use source installation, you need to install all dependencies manually.

So, first, update the package list and install all dependencies for Git on Ubuntu system using the following command.

$ sudo apt update
$ sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip

After installation of all dependencies go to the Git project on GitHub and copy the package link that ends with .tar.gz:

I have got the latest version 2.22.0 at the time of writing this article as you can see in the above picture.

Now download the Git source file in the /usr/src directory. Generally, we kept all source files at this location, to do this first need to change the directory with the following command:

$ cd /usr/src/

Now you can use the wget command to download the Git source file with name git.tar.gz, as shown below:

$ sudo wget -O git.tar.gz

Once the file gets downloaded, the file needs to extract and get into the new directory.

$ sudo tar –xzf git.tar.gz
$ cd git-*

Now, before installation needs to compile the source files by using the following command:

$ sudo make prefix=/usr/local all

After completion of a successful compilation, you can install git using this command:

$ sudo make prefix=/usr/local install

When you get the prompt after successful completion of Git installation, you should add folder location into PATH variable and verify it by checking the version of installed Git, as shown below:

$ sudo export PATH=$PATH:/usr/src/git-2.22.0
$ git --version
git version 2.22.0

There is the only problem with source installation is when you want to upgrade on latest version again you need to repeat the installation process.

Git Configuration

After installation of Git version control system needs to set up the email and username for Git commit, you can do it by using the following command:
$ git config - -global “Your UserName”
$ git config - -global “Your email ID”

When the above operation for setting the email ID and username completed, you can verify by using the following command:

$ git config --list
[email protected]

The configuration saved into the ~/.gitconfig file:

	name = satish
	email = [email protected]

If you want to make a change in this configuration, you can use the git config command or edit the ~/.gitconfig file manually.


Now you have learned Git Version control system installation on Ubuntu 17.04 Operating system; you can also check highly recommended book on git – Pro Git to learn more about Git.

If you get any problem while installing Git into your system or have any feedback, feel free to leave a comment below.

Satish Kumar

Satish Kumar

I am Satish Kumar, Founder of LinuxConcept. Linux and F.O.S.S enthusiast, love to work on open source platform and technologies.










Related Posts

Delete a user account from Ubuntu Desktop or Server

If you no longer need a user account, it is good idea to delete that account.Getting ready You will need super user or root privileges to delete a group from the Ubuntu server.How to do it... Follow these steps to delete the user account:Enter the following command to...

Creating a group on Ubuntu Desktop or Server

Group is a way to organize and administer user accounts in Linux. Groups are used to collectively assign rights and permissions to multiple user accounts.Getting ready You will need super user or root privileges to add a group to the Ubuntu server.How to do it......

Creating a user account on Ubuntu desktop or server

Suppose you have already installed the Ubuntu desktop or server. In that case, it means you have already created a default user on your system, even on the cloud also Ubuntu is installed with preconfigured default user account. You can do all administrative tasks...



Submit a Comment

Your email address will not be published. Required fields are marked *

nineteen − eight =

News & Updates

Join Our Newsletter