Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install CURL on Ubuntu 18.4LTS (libcurl4 required) but installing it remove libcurl3 and thus mongo not working properly

Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.1) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

like image 588
Maaz Ali Avatar asked Jul 01 '18 20:07

Maaz Ali


2 Answers

You have to do some custom things in order to run mongodb 4.0 in ubuntu 18.10

sudo apt-get install libcurl3

locate libcurl3 file likely in /usr/lib/x86_64-linux-gnu/, make a LD_LIBRARY folder in home, copy the libcurl.so.4 there and rename to libcurl.so.3

 mkdir ~/LD_LIBRARY
 cp /usr/lib/x86_64-linux-gnu/libcurl.so.4 ~/LD_LIBRARY/
 mv ~/LD_LIBRARY/libcurl.so.4 ~/LD_LIBRARY/libcurl.so.3

make a link of libcurl3 by:

cd ~/LD_LIBRARY
ln -s libcurl.so.3 libcurl.so.4
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/LD_LIBRARY/" >> ~/.bashrc
source ~/.bashrc

now start mongod it will run.

Also now you can install

sudo apt-get install libcurl4 php-curl

And use all the application require php-curl and libcurl4

like image 88
bhawnesh dipu Avatar answered Oct 24 '22 07:10

bhawnesh dipu


Here is How I solve curl installation error:

First I install required version of libcurl4 on which curl depends:

 sudo apt-get install curl

This command give error that

 curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.8ppa2) but it is not going to be installed

I first install libcurl4 required version which in my case is libcurl4-7.58.0-2ubuntu3.8ppa2 note in your case it my differ:

sudo apt-get install libcurl4=7.58.0-2ubuntu3.8ppa2

After installation of libcurl4 I install curl which get installed and work fine:

sudo apt-get install curl
like image 40
Block Crasher Avatar answered Oct 24 '22 06:10

Block Crasher