Upgrade cURL to latest version on Ubuntu

Tested on Ubuntu 16.04 only.

Login as root then do the following:

mkdir latestcurl
cd latestcurl
apt build-dep curl

If E: Unable to find a source package for curl error appears then do the following otherwise skip the below part.

sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
apt update
apt build-dep curl

Then do the following:

apt install libnghttp2-dev libbrotli-dev libc-ares-dev
wget https://curl.haxx.se/download/curl-7.65.3.tar.bz2
tar -xvjf curl-7.65.3.tar.bz2
cd curl-7.65.3

Now configure

./configure \
--without-librtmp \
--disable-ipv6 \
--disable-file \
--disable-gopher \
--disable-dict \
--disable-doh \
--disable-ftp \
--disable-tftp \
--disable-telnet \
--disable-smtp \
--disable-imap \
--disable-pop3 \
--disable-smb \
--disable-rtsp \
--disable-ldap \
--disable-tls-srp \
--disable-crypto-auth \
--with-nghttp2 \
--with-brotli \

Now create

make install

Remove latestcurl directory.

rm -rf ./latestcurl