How to Manually Update Curl on Ubuntu Server

Yann Mulonda
3 min readJun 5, 2020

Install Latest curl version on Ubuntu OS/Server

What is curl

Curl is used in command lines or scripts to transfer data. It is also used in cars, television sets, routers, printers, audio equipment, mobile phones, tablets, set-top boxes, media players and is the internet transfer backbone for thousands of software applications affecting billions of humans daily.

Learn more here: https://curl.haxx.se/

Curl is a command-line tool and library for transferring data with URL syntax, supporting HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP. libcurl offers a myriad of powerful features.

Want to read this story later? Save it in Heyday.

So I recently need to update curl, but Ubuntu has limitations as to what version of curl should be installed on a specific Ubuntu version. The following are curl version that’ll install in your server based on the server Ubuntu version when you run apt install -y curl

cURL 7.35.0 is the most recent and secure version for Ubuntu 14.04

cURL 7.47.0 is the most recent and secure version for Ubuntu 16.04

cURL 7.58.0 is the most recent and secure version for Ubuntu 18.04

cURL 7.68.0 is the most recent and secure version for Ubuntu 20.04

Learn more about Ubuntu version here: https://wiki.ubuntu.com/Releases

Like most Linux distributions, Ubuntu backports security patches so that software like cURL can stay secure without breaking other software by changing the version.

In my case, I’m using Ubuntu server 16.04 in my docker image that builds OpenShift pods that process metrics collection. The curl version was 7.47.0and it was failing to curl the endpoints for metrics collections. So we needed to have (at least7.57.0 or above). So since usingapt install curlmethod wasn’t an option, I had to upgrade it manually.

How to Install Latest Curl Version

Follow these steps to install the latest version of curl on your Ubuntu OS/server regardless of the version. (make sure that you are root by running the following command: sudo su) or add sudo in from the commands.

Step 1 :

Remove the currently installed curl if installed:

apt remove curl
apt purge curl

Step 2:

Install the tools to compile this release and curl dependencies:

apt-get update
apt-get install -y libssl-dev autoconf libtool make

Step 3:

Download and install the latest release from http://curl.haxx.se/download.html. Run this commands one by one in ssh terminal:

cd /usr/local/src
rm -rf curl*
wget https://curl.haxx.se/download/curl-7.70.0.zip
unzip curl-7.70.0.zip

Compile:

cd curl-7.70.0     # enter the directory where curl was unpacked #
./buildconf
./configure --with-ssl
make
make install

Step 4:

Update the system’s binaries and symbol lookup (which libcurl your curl loads):

mv /usr/bin/curl /usr/bin/curl.bak
cp /usr/local/bin/curl /usr/bin/curl

You are done🥳! The following will display your version of curl:

curl -V--if you get a curl: symbol lookup error: curl: undefined symbol:--sudo ldconfig

If you enjoyed this article, you might also likeHow to get the execution time of a script

Cheers!!!

👋 Save this story in Heyday.

--

--

Yann Mulonda

Co-Founder & CIO @ITOT | DevOps | Senior Site Reliability Engineer @ICF󠁧󠁢󠁳󠁣󠁴 | "Learning is experience; everything else is just information!”