Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm facing this issue in my Ubuntu 20.04.2 LTS (fossa-charmander-14 X60). I've bought new DELL Latitude 5420. When I type the command "curl" this error shows up.

curl: symbol lookup error: curl: undefined symbol: curl_url_cleanup
parveen@eagle:~$ sudo apt install curl
[sudo] password for parveen: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version (7.68.0-1ubuntu2.7).
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.

It says I already have curl, but I think it's not properly linked. When I type "man curl" it shows all manual docs about curl. But it's not working, please help me guys.

Try 'sudo ldconfig'. There are a couple of posts on the internet about that issue. Did you originally compile when you installed, or did you use the apt package manager ? – SScotti Sep 20, 2021 at 14:42 @SScotti I tried this command before after the compilation but it didn't work. First I used the apt package manager but when it didn't work I used the compilation method. – PS95 Sep 20, 2021 at 17:13 Hey guys, I found a solution. 1). First I used this command "sudo rm -rf /usr/local/bin/curl*" to remove curl from from. – PS95 Sep 21, 2021 at 2:17

I found a solution. First I used this command sudo rm -rf /usr/local/bin/curl* to remove curl from this location. Then if I type curl it shows me the error bash: /usr/local/bin/curl: No such file or directory. Then I used type curl which gave me the output curl is hashed (/snap/bin/curl). Then I used hash -d curl, after this my curl started working.

Comments from this answer really helped.

Hey PS95, welcome to StackOverflow! I edited the formatting of your anwser to increase its readability. Please make sure to have your anwsers properly formatted, so other users have an easier time reading your anwser. You can find info regarding formatting here. – Basti Funck Nov 1, 2021 at 13:41 The problem is that snap curl has some issues that break other libraries. Wehn I try to use nvm or rvm for instance, curl seems to be unable to create new files, so I changed to curl from apt... And the problem came back. I am looking for a solution that keeps me from using curl from snap. – André Guimarães Aragon Nov 4, 2022 at 12:35

I found a different solution for this problem. I did the following:

1st - find out where was the dependency of curl to libcurl. For some reason there is an issue with this link.

sudo ldd $(which curl) | grep libcurl

The output pointed to a link at the following location:

/usr/local/lib/libcurl.so.4

Then I used the command:

sudo apt-get purge curl

After purging curl, I checked to see if that file was there, and it was there indeed. So I did the following:

sudo rm /usr/local/lib/libcurl.so.4 (or the path that you got previously)

And than I reinstalled curl with the following commando:

sudo apt-get install curl

And everything started working afterwards!!!

Note: Problem returns after installing certain packages

After installing other packages the problem came back and I had to repeat the process. So it is not a very stable solution. Apparently the file that I deleted was created back again. I am still looking for a permanent solution.

I was getting the following error.

~> curl
curl: symbol lookup error: curl: undefined symbol: curl_url_set, version CURL_OPENSSL_4

I reinstalled curl with snap and it solved my problem.

~> sudo apt remove curl
~> sudo snap install curl

I also had a curl image with docker if necessary.

~> docker run curlimages/curl google.com
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.