0

I have old version of curl on linux, I want upgraded the version, but old version is using by others , so i cant upgrade the old one. On windows without installation just copy curl on any drive I am able to run curl, Can i do same thing on linux means just copy the package and run the curl, if yes from where I got the package

Is there any other way? by which old version will not effect

Saakshi Aggarwal
  • 528
  • 1
  • 11
  • 26
  • just add your own version of curl binary in another directory than /usr/bin/curl ? btw given that curl is *very* backwards-compatible, do you have an example of a curl command that works with old versions of curl but not with modern versions? – hanshenrik Sep 03 '19 at 06:50
  • btw if you need a modern version of curl with SSLv2 and SSLv3 support, read this: https://stackoverflow.com/a/56394968/1067003 - i still want to know what curl commands you think you will break if you update curl though – hanshenrik Sep 03 '19 at 06:54
  • Reason is, different teams using that version and they don't want to take risk, they don't allow me to upgrade the version, that's why am search an alternative – Saakshi Aggarwal Sep 03 '19 at 12:16
  • just compile curl yourself and keep it in your own folder then. as long as you don't put your curl binary somewhere like /usr/bin/curl , it shouldn't affect anyone else. (note that you probably need a STATIC build of curl, if you use a dynamic curl binary, then it will probably try to load libcurl from something like `/usr/lib/x86_64-linux-gnu/libcurl.so.4` , which is their old version of curl) - the url i provided above explains how to compile a static version of curl. – hanshenrik Sep 03 '19 at 12:44

3 Answers3

0

This may need some clarification: are you talking about libcurl or curl itself? (I ask because around the release of Buster I experienced some issues between some programs needing libcurl3 and others wanting libcurl4 on Debian). Is this what you mean, or do you just mean an older version of curl itself? And in particular, how old and what programs are requiring it because you may be able to just update the repos and have everything run off of the newest versions.

NGeorgescu
  • 27
  • 2
0

if you're using a standard dynamically-compiled curl, then it's tricky because it will try to load the old libcurl from /usr/lib/x86_64-linux-gnu/libcurl.so.4 or something like that, but a statically compiled curl? you can just download it and put it wherever you want, it's standalone and static after all.

following the instructions from https://stackoverflow.com/a/56394968/1067003 with compiler flags "-s -Os" to tell the compiler to optimize for size, here is a statically compiled 64bit linux curl version 7.65.0 with httpS support via statically compiled openssl version 1.1.1c, which is xz-compressed and base64-encoded: https://pastebin.com/HhMYYQAS

use the following command to decompress it:

wget -O- 'https://pastebin.com/raw/HhMYYQAS' | base64 -d | xz -d > curl_static;chmod +x curl_static;

(i can't inline the base64 because it's too big for stackoverflow answers)

hanshenrik
  • 19,904
  • 4
  • 43
  • 89
0

You can try out the static curl library:

https://github.com/moparisthebest/static-curl

I tried it on an old system, and it works wonder.

Even better is that build script is provided, so you can build it yourself if using third party binary is a concern.

Ng Sek Long
  • 4,233
  • 2
  • 31
  • 38