rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

r-base:4.0.2 and libcairo2-dev #411

Closed cdueben closed 4 years ago

cdueben commented 4 years ago

r-base:4.0.2 appears to be incompatible with system library libcairo2-dev.

Dockerfile:

FROM r-base:latest

RUN apt-get update && apt-get -f install -y \
    libcairo2-dev

Resulting error:

The following packages have unmet dependencies:
 libmount-dev : Depends: libmount1 (= 2.35.2-7) but 2.36-1 is to be installed
 libselinux1-dev : Depends: libselinux1 (= 3.0-1+b3) but 3.1-2 is to be installed
E: Unable to correct problems, you have held broken packages.

This issue does not show up when using an earlier r-base version. I.e. the following Dockerfile does not produce this error:

FROM r-base:4.0.1

RUN apt-get update && apt-get -f install -y \
    libcairo2-dev

Any ideas why that might be the case?

I tried various solutions. They include (i) adding a line updating and upgrading the image before installing libcairo2-dev, (ii) using the aptitude installer and (iii) attempting to install the dependencies before installing libcairo2-dev. The error remains.

eddelbuettel commented 4 years ago

I cannot reproduce this. I just fired up r-base which is the same container and ran (interactively, checking if something odd were to be shown)

$ apt update
$ apt upgrade
$ apt install libcairo2-dev

What you describe can sometimes happen between Debian "testing" and "unstable". We default to "testing" but some packages are sometimes held back because of an ongoing transition; in that case apt install -t unstable nameOfPackage is your solution,

As I cannot reproduce I suggest we close this.

eddelbuettel commented 4 years ago

Ah yes, and I see it now after I pull r-base first:

[...]
The following packages have unmet dependencies:
 libmount-dev : Depends: libmount1 (= 2.35.2-7) but 2.36-1 is to be installed
 libselinux1-dev : Depends: libselinux1 (= 3.0-1+b3) but 3.1-2 is to be installed
E: Unable to correct problems, you have held broken packages.

So as suggested:

$ apt install -y -t unstable libcairo2-dev

works just fine. This will resolve itself "at some point", likely some graphics library is transitioning.

cdueben commented 4 years ago

Thanks.