简体   繁体   中英

unsatisfiable constraints error when installing pdftk alpine linux

When trying to install pdftk apk throws this error.

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

Here is the whole output:

/opt/app # apk add pdftk
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  pdftk (missing):
    required by: world[pdftk]

I'm new to apk and not sure what the issue means or how to fix it.

The pdftk package for Alpine was discontinued starting with Alpine v3.9.

For using pdftk on Alpine, you could build the package from source, as suggested.
Alternatively, if you're comfortable with using an older Alpine version, you should be able to use it on Alpine V3.8.

Unfortunately, you won't be able to install pdftk from Alpine 3.8 repositories on a newer Alpine version due to unsatifiable constraints .

I just installed it the same way it is done on debian using the java port of pdftk. Works fine.

apk add openjdk8
wget https://gitlab.com/pdftk-java/pdftk/-/jobs/924565145/artifacts/raw/build/libs/pdftk-all.jar
mv pdftk-all.jar pdftk.jar

Create a file called pdftk

$ nano pdftk

    #!/usr/bin/env bash
    java -jar "$0.jar" "$@"

Update file permissions and move it to bin directory

chmod 775 pdftk*
mv pdftk* /usr/local/bin

Then test with pdftk -version and you should see output similar to:

pdftk port to java 3.2.2 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2017-2018 Marc Vinyals - https://gitlab.com/pdftk-java/pdftk
Copyright (c) 2003-2013 Steward and Lee, LLC.
pdftk includes a modified version of the iText library.
Copyright (c) 1999-2009 Bruno Lowagie, Paulo Soares, et al.
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Note that the pdftk java url will likely change. Get the latest here: https://gitlab.com/pdftk-java/pdftk#pre-built-binaries

I have also posted my answer on the alpine git: https://gitlab.alpinelinux.org/alpine/aports/-/issues/10136

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM