Install cURL 7.71.0 on Ubuntu 18.04 Server From Scratch

Install cURL 7.71.0 on Ubuntu 18.04 Server From Scratch

In this quick tutorial, we will learn how we can install cURL 7.71.0 on Ubuntu 18.04 from scratch. By default, the latest cURL Version, available for install on Ubuntu 18.04 is 7.58.0 is quite old, and was released back in January 2018. By following this tutorial you will be able to install cURL 7.71.0 on your Ubuntu 18.04 server.

Brief Description of cURL

cURL stands for client URL. It is a widely used command-line tool to transfer data to and from servers. It supports a wide variety of protocols such as HTTP, HTTPS, FTP, and many more. cURL is compatible with a wide variety of operating systems and hardware which allows it to run on almost any system that exists today. It is used widely in Televisions, Routers, Audio Systems, Media Boxes, Smartphones, Tablets, and many more.

Getting Started

Before getting started with this tutorial on installing cURL 7.71.0 on Ubuntu 18.04 from scratch you show have already:

  1. Set Up VPS with Ubuntu 18.04 LTS
  2. Login as root user
  3. Completely Update Your Ubuntu 18.04 LTS Server using the following commands:
sudo su
apt-get update && apt-get upgrade

Once you have updated your system you can follow the steps below to update and install cURL 7.71.0 on your Ubuntu 18.04 Server.

Steps in this Tutorial

  1. Installing necessary dependencies for cURL 7.71.0
  2. Building and Installing cURL 7.71.0 from Source
  3. Verifying the updated cURL version

1. Installing Necessary Dependencies for cURL 7.71.0

Let’s start the process of installing and updating cURL 7.71.0 on Ubuntu 18.04 LTS by installing the necessary packages and dependencies required for installing cURL 7.71.0

  • First Update your Ubuntu server by using the command given in the Getting Started section of this article.
  • Once you have updated your system, you are ready to install the necessary dependencies required to build and install cURL 7.71.0 on Ubuntu 18.04 Server form source. Use the following command to install the required packages.
apt-get install wget gcc openssl libssl-dev make -y 
  • Download the latest cURL source code. You can visit the official cURL download page to get the latest version of cURL. At the time of writing this post, the latest version is 7.71.0. So we will be downloading and installing the same.
wget https://curl.haxx.se/download/curl-7.71.0.tar.gz
  • Extracting the downloaded tar.gz file.
unzip -c curl-7.71.0.tar.gz | tar xvf -
  • Once the extraction process is complete you are ready to compile the source code and install cURL 7.71.0 on Ubuntu 18.04 Bionic server.

2. Building and Installing cURL 7.71.0 from Source

Once you have extracted the tar.gz file you can now proceed to build the cURL source code. For that you can follow the commands given below:

  • Change your directory to curl-7.71.0
cd curl-7.71.0
  • Now we will configure cURL with SSL using the following command.
./configure --with-ssl
  • Once you run the command above you will get a output something like this.
  Host setup:       x86_64-pc-linux-gnu
  Install prefix:   /usr/local
  Compiler:         gcc
   CFLAGS:          -Werror-implicit-function-declaration -O2 -Wno-system-headers -pthread
   CPPFLAGS:        
   LDFLAGS:         
   LIBS:            -lssl -lcrypto
  curl version:     7.71.0
  SSL:              enabled (OpenSSL)
  SSH:              no      (--with-{libssh,libssh2})
  zlib:             no      (--with-zlib)
  brotli:           no      (--with-brotli)
  GSS-API:          no      (--with-gssapi)
  TLS-SRP:          enabled
  resolver:         POSIX threaded
  IPv6:             enabled
  Unix sockets:     enabled
  IDN:              no      (--with-{libidn2,winidn})
  Build libcurl:    Shared=yes, Static=yes
  Built-in manual:  enabled
  --libcurl option: enabled (--disable-libcurl-option)
  Verbose errors:   enabled (--disable-verbose)
  Code coverage:    disabled
  SSPI:             no      (--enable-sspi)
  ca cert bundle:   /etc/ssl/certs/ca-certificates.crt
  ca cert path:     no
  ca fallback:      no
  LDAP:             no      (--enable-ldap / --with-ldap-lib / --with-lber-lib)
  LDAPS:            no      (--enable-ldaps)
  RTSP:             enabled
  RTMP:             no      (--with-librtmp)
  Metalink:         no      (--with-libmetalink)
  PSL:              no      (libpsl not found)
  Alt-svc:          no      (--enable-alt-svc)
  HTTP2:            disabled (--with-nghttp2)
  HTTP3:            disabled (--with-ngtcp2, --with-quiche)
  ESNI:             no      (--enable-esni)
  Protocols:        DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
  Features:         SSL IPv6 UnixSockets AsynchDNS NTLM NTLM_WB TLS-SRP HTTPS-proxy
  • Now cURL is configured properly with SSL and you are ready to install cURL 7.71.0 on Ubuntu 18.04 server. Use the following commands now to install cURL
make
make install

3. Verifying the Updated cURL version

Now since you have installed cURL 7.71.0 on your Ubuntu 18.04 Server from source, you can verify the same using the command given below.

curl --version

After running this command you will get an output like this which verifies that you have installed cURL 7.71.0 properly.

[email protected]:~# curl -V
curl 7.71.0 (x86_64-pc-linux-gnu) libcurl/7.71.0 OpenSSL/1.1.1
Release-Date: 2020-06-24
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS HTTPS-proxy IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets

If you encounter one of the errors given below after running the above command you can troubleshoot by following some additional steps.

curl: symbol lookup error: curl: undefined symbol: curl_url_cleanup
curl: symbol lookup error: curl: undefined symbol: curl_mime_free

Run the following commands to troubleshoot the errors and then verify it using the curl –version command.

apt build-dep curl
ldconfig

That’s it

If you have any kind of questions, doubts, or comments about this tutorial, make sure you post them below. I will try to reply them ASAP ❤️

Thanks

Leave a Comment