19

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?

  • 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 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? – Chris Henry Oct 14 '11 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 – Oliver Williams Sep 20 '16 at 21:25
33

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

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:

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 city-fan url.

  • 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 0:10
  • 2
    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 Aug 15 '17 at 21:48
  • 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 – billynoah Oct 1 '18 at 17:56
  • 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
2

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.

  • 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 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 Oct 14 '11 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. – 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 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

  • The link was broken – xwlee Nov 12 '18 at 6:15
-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.

  • 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 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? – 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.