3

I'm unable to update or install curl, due to a dependency mismatch problem. (I tried removing and reinstalling, thinking that might help, but it didn't.)

My curl attempt:

pi@RECOVERY:~ $ sudo apt-get install curl
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: libcurl3 (= 7.52.1-5+deb9u1) but 7.38.0-4+deb8u5 is to be installed
E: Unable to correct problems, you have held broken packages.

And then an attempt at one of the dependencies:

pi@RECOVERY:~ $ sudo apt-get install libcurl3
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:
 libcurl3 : Depends: libgssapi-krb5-2 (>= 1.14+dfsg) but 1.12.1+dfsg-19+deb8u2 is to be installed
            Depends: libnghttp2-14 (>= 1.12.0) but it is not installable
            Depends: libpsl5 (>= 0.13.0) but it is not installable
            Depends: libssh2-1 (>= 1.7.0) but 1.4.3-4.1+deb8u1 is to be installed
            Depends: libssl1.0.2 (>= 1.0.2d) but it is not installable
E: Unable to correct problems, you have held broken packages.

I also tried sudo apt-get update && sudo apt-get upgrade && sudo apt-get -f install, but that didn't work either. Neither did sudo apt-get purge.

I see that some of the sub-dependencies (e.g. libnghttp2-14, libpsl5, etc.) are shown as "not installable." Could this have something to do with it?

How can I get past this?

--EDIT--

As requested in the comments, here's my /etc/apt/sources.list, as well as the output from apt-cache policy curl:

sources.list

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://security.debian.org stable/updates main
deb-src http://security.debian.org/ stable/updates main

apt-cache

pi@RECOVERY:~ $ apt-cache policy curl
curl:
  Installed: (none)
  Candidate: 7.52.1-5+deb9u1
  Version table:
     7.52.1-5+deb9u1 0
        500 http://security.debian.org/ stable/updates/main armhf Packages
     7.38.0-4+deb8u6 0
        500 http://mirrordirector.raspbian.org/raspbian/ jessie/main armhf Packages
        500 http://archive.raspbian.org/raspbian/ jessie/main armhf Packages
4
  • @InteXX You should flag/close (if you haven't already) your own post on Raspberry PI SE. I've voted to re-open this question here. You should avoid screenshots of error messages and instead provide the output as text. Also edit the question to address the comments here.
    – sebasth
    Oct 10, 2017 at 18:38
  • @AnthonyGeoghegan — I finally got a chance to make the edits and provide the information requested. I've also edited the original duplicate post to link to this one (unfortunately I have non-editable links pointing to that one, so I can't delete it wholesale). Would you consider voting to reopen this Q&A so that it can receive ongoing activity? This issue is critical to us; we're attempting to configure for recovery from a RansomWare attack. Thanks!
    – InteXX
    Oct 11, 2017 at 21:12
  • @sebasth — I've made the requested edits. I have two questions: 1) In your opinion, should my inability to delete the other post, due to the non-editable links pointing to it, prevent a successful reopening of the Q&A; 2) Will it be possible to contact the persons who voted to close and ask them for a vote to reopen? This issue is critical to us; we're attempting to configure for recovery from a RansomWare attack. Thanks!
    – InteXX
    Oct 11, 2017 at 21:15
  • @StephenKitt — The Q&A has been reopened, so if you'd like to post your solution I'd like to mark it as the answer. (FYI in the end I commented out all but the mirrordirector line—having noted in a clean install of the most recent upgrade, Stretch, that it's the only line—but the result was the same. Ultimately the problem was in sources.list, which you helped me with. Thanks again.)
    – InteXX
    Oct 12, 2017 at 17:22

2 Answers 2

2

Your sources.list mixes Raspbian Jessie, and Debian “stable” which is now Stretch (Debian 9); that’s why you’re running into this problem: installing curl tries to install the security update to curl from Debian 9, using dependencies from Raspbian Jessie, which doesn’t work.

To fix the problem, replace stable with jessie in sources.list:

deb http://security.debian.org jessie/updates main
deb-src http://security.debian.org jessie/updates main

Once that’s done, run apt update and then you should be able to install curl.

When following stable Debian releases, you should always use the release code-name rather than “stable” since the latter will suddenly change release when a new release is made.

0

If your Distro doesn't candidate versions of these dependencies you can add Debian repository to your /etc/apt/sources.list and install the dependencies by yourself

as suggested here

Make sure you have this line in /etc/apt/sources.list:

deb-src http://ftp.debian.org/debian/ stable main non-free contrib

APT provides a command "apt-get source" that looks in these deb-src lines (rather than plain binary deb lines) and downloads source packages. In this tutorial, you'll use "apt-src" which is a convenient wrapper around "apt-get source". Step 2

apt-get update

Step 3

sudo aptitude install apt-src

apt-src is a helper program that makes compiling source packages easy. It's not necessary, but it prevents you from having to type too many commands. Step 4

 apt-src -bi install $package

If you wanted to install 'libnghttp2-14' , run this:

apt-src -bi install libnghttp2-14 

The "b" stands for "build", the "i" stands for "install the resulting package", and the word "install" means "download the source for alpine as found in a Debian source line from sources.list". apt-src will "install" the source into the current directory, make sure you have all the required packages to build the package (a process called "satisfying the build dependencies"), build it, and install the resulting .debs.

4
  • Thank you... however, I've encountered strong warnings to not use repositories other than official Raspbian, due to the ARM architecture of the device. Does this affect your answer?
    – InteXX
    Oct 11, 2017 at 21:18
  • That would be true for the most Linux distributions, but Debian is a major distribution and you can notice here ftp.debian.org/debian/dists/stable/main that it supports arm64, armel, armhf and other architectures , dpkg is by default configured to your specific arm architecture (which you can adjust with dpkg --add-architecture <architecture> , dpkg --remove-architecture <architecture> ) so it's what it's going to download , you should be safe Oct 11, 2017 at 22:29
  • Got it, thanks. As it turns out, the problem was a couple of stray entries in my sources.list file. Once I straightened them out and ran apt update, apt-get update and apt-get upgrade, everything sailed through and I was able to successfully install curl.
    – InteXX
    Oct 11, 2017 at 22:32
  • By the way, that was a very nice tutorial :-)
    – InteXX
    Oct 12, 2017 at 1:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .