• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer

GitopsCentral

  • Home
  • Courses
  • Roadmap
  • About
  • Log In
  • Sign Up

How to install curl from source on linux

September 12, 2018 by shaik zillani

curl logo

Why install curl from Source code?

Often times, you may run into issues with curl and virtualbox compatibility, which simply doesn’t allow you to use the latest libcurl.

If you need to install virtualbox, you need to install an older version of libcurl, if you install an older version of libcurl, you cannot use the latest curl.

And the only solution is to install a compatible version of curl that matches your libcurl version. Let me show you how to install curl from source code on linux, but before that, let’s decide which version to download.

Check curl and libcurl compatibility

Let me show you what went wrong in my case. You can see that my curl and libcurl are incompatible, curl is 7.62.1 & libcurl is 7.52.1. I can do two things to fix this,

  1. OPTION-1: Install curl 7.52.1 (downgrade the curl)
  2. OPTION-2: Install libcurl 7.62.1 (upgrade the libcurl)

I will go with option-1 because I need libcurl 7.52.1 for my virtualbox. For some reason, vitualbox is not supporting the latest libcurl, so let me downgrade it.

note: Libcurl 7.52.1 is also called libcurl3

curl --version

curl 7.62.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2o zlib/1.2.11 libidn2/2.0.4 libpsl/0.20.2 (+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.32.0 librtmp/2.3

curl vs libcurl

curl: is a command line tool that existed since 1998 which allows you to transfer files to and from servers on the internet using any many protocols which curl supports.

libcurl: is a library for curl, click here for more info.

Step-1: Download the curl

download curl source

Visit the link and download the curl 7.52.1

wget https://curl.haxx.se/download/?C=M;O=D

extract the tar file & move it to /opt

tar -xvf curl-7.52.1.tar.bz2
cd curl-7.52.1

Step-2: Build from source code

Make sure you are the sudo user & have all the access.
pkgconfig path for my openssl is located at /usr/lib/pkgconfig this is typically same for all the openssl setups which are installed using apt-get. --with-ssl gives curl the ability to handle https requests.

Otherwise you will end up with below error message while requesting https based endpoints,

Protocol https not supported or disabled in libcurl

env PKG_CONFIG_PATH=/usr/lib/pkgconfig ./configure --with-ssl
./configure

Step-3: Installation

make

make install
make

That’s it, the curl is installed with libcurl3 compatible version. Please let me know if this helped you or if you have any issues, in the comments section below.

curl,  kalilinux,  linux curl,  install,  kalilinux,  libcurl,  linux,  sourcecode

Primary Sidebar

en English
ar Arabiczh-CN Chinese (Simplified)nl Dutchen Englishfr Frenchde Germanhi Hindiid Indonesianit Italianja Japanesems Malaypt Portugueseru Russianes Spanishte Telugu

Course Tags

concurrency free go golang

Recent Posts

  • Roadmap to Mastery
  • Increase SSH connection timeout
  • Check Certificate expiry in Kubernetes
  • space invaders in golang
  • creating kubernetes cluster using eksctl
  • Facebook
  • GitHub
  • YouTube

Contact

Navigation

  • goacademy pro

Footer

  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

info@gitopscentral.com


+91 8341443220

© Copyright 2016-2024 gitopscentral · All Rights Reserved ·