Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alpine Linux can't install lapack-dev on python:3.5-alpine3.4

I'm using docker python:3.5-alpine3.4 image and trying to install lapack-dev but it keeps failing. It is complaining that it can't find libgfortran.so.5. However, I've tried installing libgfortran and that does not seem to fix the problem.

(1/1) Installing libgfortran (5.3.0-r0)
OK: 33 MiB in 37 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
fetch http://dl-8.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-8.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
WARNING: This apk-tools is OLD! Some packages might not function properly.

ERROR: unsatisfiable constraints:
  so:libgfortran.so.5 (missing):

    required by:
      lapack-3.8.0-r1[so:libgfortran.so.5]

Any ideas how I can fix this? Here is the relevant RUN step.

FROM python:3.5-alpine3.4

RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
  && apk update \
  && apk add --update-cache --no-cache libgcc libquadmath musl \
  && apk add --update-cache --no-cache libgfortran \
  && apk add --update-cache --no-cache lapack-dev
like image 761
James Avatar asked Oct 09 '18 02:10

James


1 Answers

python:3.5-alpine3.4 docker image is based on Alpine v3.4. lapack-dev package was appeared only in Alpine v3.5. So, my suggestion is to install lapack-dev package from the nearest repository by time. In this case you shouldn't face issues with outdated dependencies. And it works pretty well.

The final Dockerfile is:

FROM python:3.5-alpine3.4

RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.5/community" >> /etc/apk/repositories \
  && apk update \
  && apk add --update-cache --no-cache libgcc libquadmath musl \
  && apk add --update-cache --no-cache libgfortran \
  && apk add --update-cache --no-cache lapack-dev
like image 195
nickgryg Avatar answered Nov 05 '22 22:11

nickgryg