Apk添加了pdftk不可满足的约束

时间:2018-05-02 10:24:59

标签: docker alpine pdftk

有人可以向我解释为什么我会得到一个

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

时出现

错误

apk update
apk add pdftk

在我的高山码头图片中,虽然在高山似乎是included

祝你好运

1 个答案:

答案 0 :(得分:2)

似乎在docker镜像中没有高山存储库的本地缓存。

因此,为了解决这个问题,您可以执行以下操作:

1。当您--no-cache不使用任何本地缓存路径时,请使用apk add标志:

$ 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. 首先更新本地缓存(apk update),然后安装必要的软件包(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。另请注意,从版本3.5开始,pdftk包已添加到alpine存储库中。可能是您使用alpine:3.4作为基本泊坞窗图像的情况。

P.P.S。来自高山储存库的pdftk包裹is not present 3.9。