Skip to content

Instantly share code, notes, and snippets.

@fideloper
Last active December 15, 2025 05:03
Show Gist options
  • Select an option

  • Save fideloper/f72997d2e2c9fbe66459 to your computer and use it in GitHub Desktop.

Select an option

Save fideloper/f72997d2e2c9fbe66459 to your computer and use it in GitHub Desktop.
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
cd curl-7.50.2
# The usual steps for building an app from source
# ./configure
# ./make
# sudo make install
./configure
make
sudo make install
# Resolve any issues of C-level lib
# location caches ("shared library cache")
sudo ldconfig
@kivison

kivison commented Nov 2, 2016

Copy link
Copy Markdown

This was one of those "I dont really know what I am doing" moments but trusted that you did.
Trust Confirmed! Thank you, worked a treat :)
Regards
Keet

@fideloper

Copy link
Copy Markdown
Author

I don't know what I'm doing either! 🎉 👍

@derylspielman

derylspielman commented Nov 13, 2016

Copy link
Copy Markdown

I tried upating to curl 7.51.0 but when I run curl --version I still see the old version 7.35.0.

curl: /usr/local/lib/libcurl.so.4: no version information available (required by curl)
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.51.0 OpenSSL/1.0.1f zlib/1.2.8 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP

Running which curl shows /usr/bin/curl but the script seems to install 7.51.0 in /usr/local/bin/curl. To specify /usr/bin/curl as the path it's installed to change the ./configure to ./configure --prefix=/usr

@bsingarayan

Copy link
Copy Markdown

good one, thanks!

@agarzon

agarzon commented Dec 29, 2016

Copy link
Copy Markdown

@derylspielman is right.

./configure --prefix=/usr should be used in order to replace the default curl binay located in /usr/bin/curl, tested on Ubuntu 14.04 with curl 7.52.1

@parismita

Copy link
Copy Markdown

thanks a lot <3

@Yazany6b

Yazany6b commented Jan 9, 2017

Copy link
Copy Markdown

Thanks a lot the curl was correctly but i want also to update the openssl version to 1.0.2e can i do that. i have tried many ways but no success.

@CraigChilds94

Copy link
Copy Markdown

I like!

@Uditmittal

Copy link
Copy Markdown

Thanks a lot <3 .

@vishalrekala

Copy link
Copy Markdown

Perfect!!!!
Worked like a charm

@mpachin

mpachin commented May 18, 2017

Copy link
Copy Markdown

Saved my day! Thank you!

@mangowalrus

mangowalrus commented Jun 7, 2017

Copy link
Copy Markdown

Where do I run this and how.?
I have a bitnami Magento stack on AWS and don't know how to do this.
Obviously I can upload to my site, but where do I put it and how do I run it?
Ubuntu 14.04.1 LTS - trusty - PHP 5.4.32 - curl 7.27

@mangowalrus

mangowalrus commented Jun 12, 2017

Copy link
Copy Markdown

How do you do this on a .deb installation please?
Making slight brain progress here.
Time is running away ... or it's the chemo ...

@ywfluctier

Copy link
Copy Markdown

Great! Thanks to sharer as well as @derylspielman

@kimh

kimh commented Oct 25, 2017

Copy link
Copy Markdown

Just for the people with the same issue: ./configure didn't add SSL support to curl. To do that, I first had to install libssl-dev and then ./configure automatically detect SSL without passing --with-sshl option.

@Citrullin

Copy link
Copy Markdown

Download curl with wget is like downloading Firefox/Chrome with an Internet Explorer! :D Thx by the way.

@kunasiramesh

Copy link
Copy Markdown

Thank you 👍

@sclass

sclass commented Apr 17, 2018

Copy link
Copy Markdown

Thank you.
(I have confirmed that the script works perfectly in the Ubuntu 12.04 distribution.)
Due to the this OCSP bug : https://www.cybersecurity-help.cz/vdb/SB2017022201?affChecked=1
I recommend use the latest version of curl-7.59.0

@iansmith

iansmith commented Jun 6, 2018

Copy link
Copy Markdown

Bravo!

@ag1805x

ag1805x commented Jun 14, 2018

Copy link
Copy Markdown

Superbly done. Thanks

@EyalPery

EyalPery commented Jul 19, 2018

Copy link
Copy Markdown

Thanks!
Few notes for the script which helped me:

  1. Check the latest version of curl here: http://curl.haxx.se/download/ and change the script accordingly (i.e every 7.50.2 to 7.60.0)
  2. Change ./configure to ./configure --prefix=/usr
  • Use curl --version to verify it got updated

@ZhangVic

Copy link
Copy Markdown

Thank you so much.
But I get different result in two terminals with the same version of curl
A little confused

@chsavvaidis

Copy link
Copy Markdown

Thank you so much, you saved my day

@jlis

jlis commented Nov 8, 2018

Copy link
Copy Markdown

Great help!

@Carlos-Henreis

Copy link
Copy Markdown

Perfect

@hardword

Copy link
Copy Markdown

Thanks!!!

@Globerada

Globerada commented Jan 9, 2019

Copy link
Copy Markdown

EDITED: Great... Not working. Curl is giving no response.
Also PHP info is showing another version of curl: cURL Information | 7.47.0
I did sudo service apache2 restart

ubuntu@globerada:~$ curl -Vv
curl 7.63.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Release-Date: 2018-12-12
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
ubuntu@globerada:~$ curl https://www.google.com
ubuntu@globerada:~$

Thank you, it works. I have updated to latest (7.63.0 on 2019-01-09) because I had some problems with Curl 7.49 and Guzzle.

Steps for Ubuntu 16.04

touch update_curl.sh
chmod u+wx update_curl.sh
nano update_curl.sh


#! /usr/bin/env bash
sudo apt-get build-dep curl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.63.0.tar.bz2
tar -xvjf curl-7.63.0.tar.bz2
cd curl-7.63.0
./configure --prefix=/usr
make
sudo make install
sudo ldconfig


./update_curl.sh

@jaymedici

Copy link
Copy Markdown

Thanks dude!

@Rockstar5645

Copy link
Copy Markdown

@derylspielman thanks a bunch

@riskydigital

Copy link
Copy Markdown

Fantastics! It's Works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment