27

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?

Chris Henry
  • 1,512
  • 3
  • 15
  • 15
  • Which version of CENTOS are you running? I am too lazy to cross check current kernel versions and CENTOS version numbers ... – Joseph Kern Oct 14 '11 at 00: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? – Chris Henry Oct 14 '11 at 04:36
  • OP, could you please accept an answer? The top answer worked successfully for me, and this will be helpful to future users – Oliver Williams Sep 20 '16 at 21:25

4 Answers4

45

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.

Giacomo1968
  • 3,522
  • 25
  • 38
taksan
  • 551
  • 4
  • 3
  • 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!! – Oliver Williams Sep 20 '16 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 Jul 28 '17 at 00:10
  • 4
    Before you update using city-fan, see the information on that on the official centos wiki: https://wiki.centos.org/AdditionalResources/Repositories. It is classified as a known problem repo. – Khanna111 Aug 15 '17 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` – Eaten by a Grue Oct 01 '18 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 Nov 26 '18 at 17:27
  • Worked for me on CentOS 7.6.1810. curl 7.29.0 to 7.67.0. I can see it also updated libnghttp2 libpsl libmetalink libssh2 libcurl – gaoithe Jan 08 '20 at 14:47
  • The link in the file no longer works as it can't find baseurl. – iFunction Mar 23 '20 at 12:36
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.

Joseph Kern
  • 9,809
  • 3
  • 31
  • 55
  • 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? – Chris Henry Oct 14 '11 at 04: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 http://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/ , http://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/curl-7.22.0-2.0.cf.rhel5.x86_64.rpm ought to do the trick. – Twirrim Oct 14 '11 at 04: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. – Joseph Kern Oct 20 '11 at 12:51
  • And CURL_HTTP_VERSION_2_0 is not supported in older versions as well. – andreszs Jul 28 '17 at 00: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

GiorgosK
  • 211
  • 3
  • 5
  • The link was broken – xwlee Nov 12 '18 at 06: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 Jan 08 '20 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.

TBK
  • 13
  • 4
  • None of the packages at that URL worked. Also, does the 'development' folder imply these are newer / in development packages? – Chris Henry Oct 14 '11 at 05: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? – Chris Henry Oct 14 '11 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. – James Antill Oct 14 '11 at 20:40