Apk add pdftk unsatisfiable constraints
Asked Answered
H

1

7

Can somebody explain to me why I get a

unsatisfiable constraints:
  pdftk (missing):
    required by: world[pdftk]

error when running

apk update
apk add pdftk

in my alpine docker-image, although it seems to be included in alpine?

Best regards

Hartmann answered 2/5, 2018 at 10:24 Comment(2)
At the time of writing this, pdftk is available on Alpine 3.8, but not Alpine 3.9 (which is the latest version). I simply reverted to Alpine 3.8 for now to get the desired effect.Krauss
Updated answer here: #66554437Surprisal
S
6

It seems there is no local cache of alpine repositories inside your docker image.

So, in order to fix this you can do the following:

1. Use --no-cache flag when you do apk add to not use any local cache path:

$ docker run -ti alpine:3.7
/ # apk add --no-cache pdftk
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/5) Installing libgcc (6.4.0-r5)
(2/5) Installing gmp (6.1.2-r1)
(3/5) Installing libstdc++ (6.4.0-r5)
(4/5) Installing libgcj (6.4.0-r5)
(5/5) Installing pdftk (2.02-r1)
Executing busybox-1.27.2-r7.trigger
OK: 76 MiB in 16 packages

2. Update local cache first (apk update) and then install necessary packages (apk add <package>):

$ docker run -ti alpine:3.7
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-159-g08fa87dac2 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-160-g82f356f8c4 [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
OK: 9050 distinct packages available
/ # apk add pdftk
(1/5) Installing libgcc (6.4.0-r5)
(2/5) Installing gmp (6.1.2-r1)
(3/5) Installing libstdc++ (6.4.0-r5)
(4/5) Installing libgcj (6.4.0-r5)
(5/5) Installing pdftk (2.02-r1)
Executing busybox-1.27.2-r7.trigger
OK: 76 MiB in 16 packages

P.S. Also please remember that pdftk package was added to alpine repositories starting from version 3.5. It could be the case you are using alpine:3.4 as a base docker image.

P.P.S. pdftk package is not present from alpine repositories on 3.9.

Selenography answered 2/5, 2018 at 12:41 Comment(2)
sorry, of course i do a apk update before i try to apk add <package>Hartmann
What can we do for alpine:3.9? Any suggestions?Ruthenic

© 2022 - 2024 — McMap. All rights reserved.