Installing the package in Linux by the Compile method

مدونة AiroServer


compile source code

Have you ever wanted to install or update a specific application in your Linux operating system, and you could not download and install the appropriate package for your operating system distribution through RPM or YUM? If your answer is positive, like what happened to me recently, then you must be looking for a solution and alternative for this issue since you had an urgent need to do this.You can use the Compile method to install the package in Linux.

Join me to learn about one of the most common and command-based methods of installing an application in Linux operating systems.

In such cases, the only remaining way to install the desired application is to install it through the source code of the application.

Now how does this happen?

For you to be able to install an application through the source code, you need to do this according to the defined standards, in the following order:

Download the source code of the desired application in tar.gz. format

Unpack the downloaded source code in the suggested path /usr/src

Preparing the relevant file to start the compile process

The start of the compile source code process

Transferring application executable files to desired and necessary paths

As always, it will be complicated to understand and convey such concepts without a practical example plan, so stay with me to compile one of the most used applications in Linux.

compile curl

Curl is an application that you may have used many times during your career to view the pages of a website.

We intend to download the source code of the desired application using the above method and then compile and launch it.

According to what we explained earlier, the first step in installing an application using the compile method is to download the source code of the desired application.

To download the source code related to the curl application, I follow the instructions below through wget:


After successfully downloading the desired source code, we should use the following command to unpack the desired file in the suggested path /usr/src:

tar -zxvf curl-7.86.0.tar.gz -C /usr/src

After the unpacking process related to the source code of the desired application is done, we start the compile process:

You enter the directory of the unpacked package, in our example, it is as follows:

cd /usr/src/curl-7.86.0

After entering the desired directory, the first command you will execute will be as follows:


What this command does is prepare the target source code file to start the compile process.

After preparing the source code, we proceed according to the following command to start the compile process:


This step usually takes more time depending on the type and volume of your source code.

If the compile steps are completed without errors, the last step of the compile process of your application is to execute the following command to transfer the executable files of the application to the required directories:

make install

Well, of course, it’s over. Now you can see the updated version of your curl using the curl -version command.

All our efforts are to convey the concept and share knowledge, of course, you may encounter common and sometimes uncommon errors during the process.

So finally, as always, I leave you to the powerful Google search engine.

Find More Articles...

Whats New?