As of Ubuntu 18.04, curl is being built against libcurl4. The .deb available on https://dlang.org/download.html depends on libcurl3 which conflicts with libcurl4. This makes it impossible to install the .deb without first removing curl, libcurl4 and other packages depending on libcurl4.
Comment #1 by greensunny12 — 2018-03-24T01:52:06Z
I was shocked a bit about this because I thought libcurl4 doesn't exist in Ubuntu and is currently only available in experimental in Debian:
https://packages.debian.org/experimental/libcurl4https://packages.ubuntu.com/search?keywords=libcurl&searchon=names&suite=artful§ion=all
The binary library is called libcurl3 (the API/development packages is libcurl4-dev)
https://askubuntu.com/questions/469360/what-is-the-difference-between-libcurl3-and-libcurl4
However, I tried this myself in Docker and I can reproduce this:
---
root@84fd31deb36c:/# apt-get install libcurl3
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
dmd : Depends: libc6-dev but it is not going to be installed
Depends: gcc but it is not going to be installed
libcurl3 : Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not going to be installed
Conflicts: libcurl4 but 7.58.0-2ubuntu3 is to be installed
libcurl4 : Conflicts: libcurl3 but 7.58.0-2ubuntu2 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
---
---
root@84fd31deb36c:/# apt-get install libcurl4
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcurl4 is already the newest version (7.58.0-2ubuntu3).
libcurl4 set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
dmd : Depends: libc6-dev but it is not going to be installed
Depends: gcc but it is not going to be installed
Depends: libcurl3 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
---
At least it seems like dmd isn't the only application: https://bugs.launchpad.net/ubuntu/+source/curl/+bug/1754294
BTW the file that creates the DEB ball is here:
https://github.com/dlang/installer/blob/master/linux/dmd_deb.sh#L347
I'm not sure what's the best fix for this as libcurl4 doesn't exist in Debian (and the DEB ball is supposed to be general-purpose).
Comment #2 by greensunny12 — 2018-03-24T02:09:14Z
Background info on the rename:
https://launchpad.net/ubuntu/+source/curl/7.58.0-2ubuntu2
Rename libcurl3 to libcurl4, because libcurl exposes an SSL_CTX via
CURLOPT_SSL_CTX_FUNCTION, and this object changes incompatibly between
openssl 1.0 and openssl 1.1.
Comment #3 by greensunny12 — 2018-03-24T02:14:59Z
BTW @Alex: as another an alternative until this is resolved, you might want to try the install script:
https://dlang.org/install.html
Comment #4 by alex.whitman — 2018-03-26T08:33:29Z
My 18.04 install was done just before curl was moved to libcurl4 so for now I'm holding back the upgrade of those packages, meaning I was able to install the 2.079.0 deb.
The solution might be as simple as changing the dependency to libcurl3 OR libcurl4 but I don't know the internals at all to know if that would work.
Comment #5 by greeenify — 2018-03-26T08:52:14Z
The "official" deb ball is supposed to run on Debian too, so probably the only solution for a universal deb ball would be to drop the dependency on libcurl. It's only used for std.net.curl and dynamically loaded when needed.
The d-apt registry should be able to set the dependency correctly though.
- The libcurl dependency should be demoted to recommended (installed by default) or suggested, atm. it's still a dependency.
- It's confusing to see libcurl3 as dependency and libcurl4-openssl-dev as suggestion.
https://github.com/dlang/installer/blob/47830a15d1a576b683c92b4bb4adc4a1d83a2b5d/linux/dmd_deb.sh#L347-L348
Has anyone ever succeeded to install that with `-o APT::Install-Suggests="true"` or `--install-suggests`?
- It's a pity that debian doesn't have a meta-package for libcurl, but I'd research how other packages resolved this issue (libcurl-ocaml depends on libcurl3-gnutls while libcurl-ocaml-dev depends on libcurl4-gnutls-dev).
- Use an alternative package name `libcurl4 | libcurl3` to support installations without libcurl4 availability. Assuming that all OSes with libcurl4 switch to that by default, otherwise you'd be back to the conflict.
So how about:
DEPENDS='libc6, libc6-dev, gcc, libgcc1, libstdc++6'
RECOMMENDS='libcurl4 | libcurl3'
SUGGESTS='libcurl4-openssl-dev, gcc-multilib'
Comment #8 by alex.whitman — 2018-04-04T14:06:09Z
I've given Martin's suggestion of using Recommends a go and it appears to work. The steps I took were:
- Purge existing dmd installation
- Upgrade curl, bringing in libcurl4, removing libcurl3
- Unpacked dmd_2.079.0-0_amd64.deb
- Edited the control file with the changes to the Depends section and added the Recommends section.
- Repacked the .deb
- Installed the .deb
The installation worked but I don't have anything that uses std.net.curl to test.
Comment #9 by github-bugzilla — 2018-04-17T07:42:30Z
Commits pushed to master at https://github.com/dlang/installerhttps://github.com/dlang/installer/commit/4790451e11f3891cf74efa54b9e1b2e29fd4eaa9
fix Issue 18649 - curl on Ubuntu 18.04 depends on libcurl4, ...
... .deb installer depends on libcurl3
- depend on libcurl4 | libcurl3 alternative
- degrading libcurl from dependency to recommends would be welcome,
but does not work because recommendations are not installed for raw
.deb packages (--fix-broken only installs dependencies).
`dpkg -i dmd_2.079.1-0_amd64.deb && apt-get --fix-broken install`
- also add suggested libcurl-dev alternative
https://github.com/dlang/installer/commit/8233177ccc37c4ca5e6a8cfdc39b0a06ece5b2d7
Merge pull request #318 from MartinNowak/test_pkg_install
fix Issue 18649 - curl on Ubuntu 18.04 depends on libcurl4, ...
Comment #10 by p.ivanchyshyn — 2019-01-25T13:19:24Z
Well,
I have `libcurl4-openssl-dev` and `libmediainfo-dev` packages as dependencies for my project.
These packages can't be installed because of issue:
libcurl4-gnutls-dev : Conflicts: libcurl4-openssl-dev but 7.58.0-2ubuntu3.5 is to be installed
libcurl4-openssl-dev : Conflicts: libcurl4-gnutls-dev but 7.58.0-2ubuntu3.5 is to be installed
apt install --fix-broken doesn't help.
Comment #11 by miles.lane — 2020-04-12T14:17:30Z
gem install curb -v '0.9.10'
also fails to install because of this issue.
Comment #12 by robert.schadek — 2025-01-02T15:46:51Z