32

I need to upgrade cURL to the latest version on Centos

2.6.18-164.15.1.el5.centos.plusxen #1 SMP Wed Mar 17 20:32:20 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

I'm unable to find any suitable packages to do so via yum or rpm. Is there a standard way to do this upgrade without installing from source?

3
  • Which version of CENTOS are you running? I am too lazy to cross check current kernel versions and CENTOS version numbers ... Commented Oct 14, 2011 at 0:15
  • Too lazy or too cool? (kidding) We're running 5.4, most of the time. Occasionally 5.6 Is there a notable difference there? Commented Oct 14, 2011 at 4:36
  • OP, could you please accept an answer? The top answer worked successfully for me, and this will be helpful to future users Commented Sep 20, 2016 at 21:25

4 Answers 4

47

This is an old question, but it is still one the first results in google search, so I'd like post the solution that solved my problem.

  1. Create a new file /etc/yum.repos.d/city-fan.repo

  2. Paste the following contents:

    [CityFan]
    name=City Fan Repo
    baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch/
    enabled=1
    gpgcheck=0
    
  3. Type this into the terminal:

    yum clean all
    yum install curl 
    
  4. And it's done!

Observe that for other RHEL/CentOS versions, all you have to do is specify the appropriate CityFan URL.

7
  • Confirming that (on my version of Centos 6.5), this is the only thing that worked. Simply typing in yum update curl or yum install curl alone did NOT work!! Commented Sep 20, 2016 at 21:18
  • Should I delete the city-fan.repo after updating? I've read it could cause problems when getting other non-official updates.
    – andreszs
    Commented Jul 28, 2017 at 0:10
  • 4
    Before you update using city-fan, see the information on that on the official centos wiki: wiki.centos.org/AdditionalResources/Repositories. It is classified as a known problem repo.
    – Khanna111
    Commented Aug 15, 2017 at 21:48
  • 2
    Beware, I tried this on a server running CentOS 7 and it broke both curl and yum with error like curl: error while loading shared libraries: libnghttp2.so.14: cannot open shared object file: No such file or directory Commented Oct 1, 2018 at 17:56
  • 1
    I tried this on the latest CentOS 7 and it worked great. (Using this repository was a semi-last resort. I first tried compiling curl myself, but it didn't support SSL by default, and compiling with SSL requires a rabbbit-hole of dependencies.)
    – James
    Commented Nov 26, 2018 at 17:27
3

Why do you need to upgrade curl? Is there a specific feature you're missing?

You can get it straight from the developer:

http://curl.haxx.se/download.html

Scroll down to the Redhat (thanks twirrim) listings, find a suitable RPM (RHEL5 based) and install.

4
  • We specifically need a feature introduced in 7.16.2, CURLOPT_TIMEOUT_MS for setting really small timeouts. We're trying to create 'fire and forget' requests. The fedora listings we've tried are actually source packages, which we're unfamiliar with. Can you provide some help/advice when upgrading via source? Commented Oct 14, 2011 at 4:24
  • 1
    On the above link what you want are the RHEL packages, CentOS5 is based on RHEL5 so packages for that should work on it. Helpfully that page only suggests there are i386 versions, but there are actually x86_64 bit versions on the link it sends you to. from mirror.city-fan.org/ftp/contrib/sysutils/Mirroring , mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/… ought to do the trick.
    – Twirrim
    Commented Oct 14, 2011 at 4:46
  • Haha. Thanks twirrim, I stopped scrolling at fedora. :-/ They look like the same packages anyway, it's just easier to filter by RHEL version than equivalent FC version. Commented Oct 20, 2011 at 12:51
  • And CURL_HTTP_VERSION_2_0 is not supported in older versions as well.
    – andreszs
    Commented Jul 28, 2017 at 0:11
0

Could not get taksan's answer to work for my setup here is what I used

yum install epel-release -y
rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-1-13.rhel6.noarch.rpm
yum update curl

more related answers can be found here Upgrading curl on centos 6: libcurl-7.50 requires libnghttp2

2
  • The link was broken
    – xwlee
    Commented Nov 12, 2018 at 6:15
  • 1
    Version 2-1 is now at that location. $ sudo rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel6.noarch.rpm However for me, centos 7.6.1810 (and curl 7.29.0) using 2-1.rhel7 did not result in curl updating version :-(
    – gaoithe
    Commented Jan 8, 2020 at 14:41
-1

Latest stable curl verison is 7.22.0, but so far 7.19.7-16 is the CentOS latest. So you either have to find a repository that offers the latest build now or wait for the CentOS base repo to update the build.

yum update curl

I found a repo for you:

http://download.fedora.redhat.com/pub/fedora/linux/development/rawhide/x86_64/os/Packages/?P=*curl*

You could wget the libcurl and curls files from the link above and then rpm –Uvh packagename, install the libcurl and then the curls pack.

3
  • None of the packages at that URL worked. Also, does the 'development' folder imply these are newer / in development packages? Commented Oct 14, 2011 at 5:04
  • So I actually did some research into those packages. It seems like Fedora using SHA checksums while rpm requires md5. From a lot of googling, it seems there is a process to circumvent that. Are you aware of what it is? Commented Oct 14, 2011 at 14:56
  • Yes, don't use Fedora packages in RHEL ... and esp. don't use newer Fedora packages in RHEL-5. You might be able to rebuild the latest Fedora .src.rpm for RHEL-5 ... but you'll get to keep all the pieces if you do that. In general you shouldn't be trying to upgrade core OS components. Commented Oct 14, 2011 at 20:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .