Ubuntu – Stuck trying to install libcurl4

aptcurlpackage-managementupdates

I somehow got myself in a screwy situation on Ubuntu 18.04 where I have libcurl3 installed, something tried to install libcurl4, and now I'm stuck in a situation where Ubuntu can't install libcurl4 and because of that can't install anything as no matter what I try to do it first tries to install libcurl4 and fails.

This is what I end up at:

The following additional packages will be installed:
  libcurl4
The following NEW packages will be installed:
  libcurl4
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
Need to get 214 kB of archives.
After this operation, 641 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Ign:1 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.2
Err:1 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.2
  404  Not Found [IP: 2001:67c:1360:8001::17 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/c/curl/libcurl4_7.58.0-2ubuntu3.2_amd64.deb  404  Not Found [IP: 2001:67c:1360:8001::17 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

From the looks of it it's trying to grab a version of libcurl4 that straight up doesn't exist in the repos? How can I get it to grab the correct version?

Best Answer

You can add it to the repository:

sudoedit /etc/apt/sources.list

Then add this and save:

deb http://security.ubuntu.com/ubuntu bionic-security main

sudo apt-get update
sudo apt-get install libcurl4-openssl-dev --fix-broken

Note: the libcur14-openssl-dev is the development version of the libcurl4, which could be used to build applications against libcurl (to include headers and some additional documentation). And there are actually different dev version of libcurl package that you could chose from depending on the backend TLS you would like to use: libcurl4-openssl-dev, libcurl4-nss-dev & libcurl4-gnutls-dev.

Related Question