DEV Community

Jake Casto
Jake Casto

Posted on

Using libcurl3 and libcurl4 on Ubuntu 18.04 (Bionic)


I'm sure many of us have needed to run libcurl3 and libcurl4 on Ubuntu 18 for some reason at any point in time.

On Ubuntu 18.04 (Bionic) libcurl3 and libcurl4 cannot coexist. Many third party packages, libraries, etc require libcurl3 while curl itself requires libcurl4.

Please note, this solution is only for precompiled commands (and potentially binaries, not tested). This was tested on a C# binary.

First you'll need to get a copy of libcurl3 and save it to your /usr/lib directory. You can do that by running:

$ sudo apt-get install libcurl3 -y
$ cp /usr/lib/x86_64-linux-gnu/ /usr/lib/
Enter fullscreen mode Exit fullscreen mode

Then remove libcurl3 and reinstall libcurl4:

$ sudo apt-get install libcurl4 libcurl4-openssl-dev -y
Enter fullscreen mode Exit fullscreen mode

Finally prepend env LD_PRELOAD=/usr/lib/ to any commands that require libcurl3.

Top comments (13)

ahukkanen profile image
Antti Hukkanen

I'd also like to add here that it is not necessary to install the libcurl3 package since you can just download it and extract the .so-file you need from there.

This is what I eventually did:

$ mkdir ~/libcurl3 && cd ~/libcurl3
$ apt-get download -o=dir::cache=~/libcurl3 libcurl3
$ ar x libcurl3* data.tar.xz
$ tar xf data.tar.xz
$ cp -L ~/libcurl3/usr/lib/x86_64-linux-gnu/ /usr/lib/
$ cd && rm -rf ~/libcurl3

What it does:

  • Create a temporary libcurl3 directory in your home path and go there
  • Download the libcurl3 package to the newly created folder
  • Extract a file named data.tar.xz from that package archive
  • Extract the data.tar.xz file to the current folder
  • Copy the referenced file of the symlink to /usr/lib/ (don't mind the .4 suffix, as noted it is actually version 3)
  • Go back home and remove the temporary directory from your home path
swiftwinds profile image

After installing libcurl3, /usr/lib/x86_64-linux-gnu/ still did not exist

ahukkanen profile image
Antti Hukkanen

I believe they have just changed the file name as you can see from the libcurl3 package details:

As confusing as it is, the file is actually named So, after installing libcurl3, this should work:

$ cp /usr/lib/x86_64-linux-gnu/ /usr/lib/

After that, follow the advice in the original post.

jake profile image
Jake Casto

It may be a system specific issue, run the find command to locate it.

izzyb_brah profile image
Izzy B

Happened to me as well, ubuntu 18.04. I'm looking in the /usr/lib directory and the best I got is

Thread Thread
jake profile image
Jake Casto

Hmmm that’s strange, try searching globally for libcurl*.so?

ribbreaker97 profile image

Interestingly enough, there was a in /usr/lib/x86_64-linux-gnu/. Moving that to usr/lib/ and then installing libcurl4 enabled me to run both libcurl3 and libcurl4 programs. Confusing naming convention to be honest :/

jake profile image
Jake Casto

Weird (but glad it worked for you) and I agree, it’s totally weird.

lin4fun profile image

Found this at
Looks like better solution..

"I just fixed it but had to rebuild the deb package.

Download the .deb installer file
Inside the folder your downloaded the file run dpkg-deb -R ./Brackets.Release.1.12.64-bit.deb Brackets
Edit file Brackets/DEBIAN/control and replace libcurl3 with libcurl4
Rebuild .deb installer running dpkg-deb -b Brackets Brackets-fixed.deb
Install Brackets using the fixed installer running sudo dpkg -i Brackets-fixed.deb
At least the program opens. Don't know if there's anything broken though."

mafh profile image

I have my liburl3 at /home/user/

Getting "The following packages have unmet dependencies: google-chrome-stable : Depends: libcurl3 but it is not going to be installed" with

sudo env LD_PRELOAD=/home/user/
sudo apt install ./chrome64_52.0.2743.116.deb


sudo env LD_PRELOAD=/home/user/ apt install ./chrome64_52.0.2743.116.deb

Any ideas?

jake profile image
Jake Casto

You’ll have to download manually download the Chrome binary. It doesn’t work with apt commands.

bozeyman9000 profile image
bozeyman9000 • Edited

any hope or any other info about running both of these simutaneously? The reason being is i want to use both steam and runescape on my linux machine. seems like ill probably be "installing" libcurl3 into a different folder then rerouting runescape to use that folder? To which i would have to ask, where would i find the code to edit such a task?

david_j_eddy profile image
David J Eddy

Helpful, thank you!