pdftk snap in 18.04 not accepting commands












1















following the simple instructions in this answer: https://askubuntu.com/a/1048975 I installed pdftk as a snap on an ubuntu 18.04 VM. (we need some of the advanced features of pdftk on the command line like fill_forms ).



my problem: the command seems to be only half installed:



/some/path # pdftk
-> Usage:
pdftk <command>

Install, configure, refresh and remove snap packages. Snaps are
'universal' packages that work across many different Linux systems,
enabling secure distribution of the latest apps and utilities for
cloud, servers, desktops and the internet of things.

This is the CLI for snapd, a background service that takes care of
snaps on the system. Start with 'snap list' to see installed snaps.

Available commands:
< long list of snap commands >


so it seems to me as if 'pdftk' is registered as a tool in the bash, but if I try to use any of the usual pdftk commands, I get an error message like this:



pdftk forms/Form_FM.pdf fill_form /tmp/adsh/2017-4_1532602497.fdf output /some/path/2017-4_KF.pdf
-> error: unknown command forms/Form_FM.pdf, see 'snap help'


(this also happens with every other command I tried)
so, how do I pass the commands and parameter to pdftk without snap trying to grab the parameter for itself?



edit: some diagnostics:



ls -l /usr/local/bin/pdftk
lrwxrwxrwx 1 root root 28 Jul 11 18:17 /usr/local/bin/pdftk -> /snap/bin/pdftk-smoser.pdftk

snap list pdftk
error: no matching snaps installed

snap list pdftk-smoser
Name Version Rev Tracking Developer Notes
pdftk-smoser 2.02-4 18 stable smoser -


hmmm...seems like I followed the older version of the answer, which had an additional step that symlinked /snap/bin/pdftk-smoser.pdftk to /usr/local/bin/pdftk










share|improve this question

























  • Hi cypherabe! Welcome to askUbuntu! The third argument of your command is /tmp/adsh/2017-4_1532602497.fdf, but it should be /tmp/adsh/2017-4_1532602497.pdf (misspelled pdf)

    – abu_bua
    Jul 26 '18 at 11:46








  • 2





    Hmm... it actually looks like you're getting the usage information for the snap command (but with the command name pdftk), rather than that of the pdftk command itself - I wonder what could have gone wrong? Did you by any chance make a symbolic link?

    – steeldriver
    Jul 26 '18 at 12:02













  • ... can you add the output of type -a pdftk please?

    – steeldriver
    Jul 26 '18 at 12:13











  • @steeldriver type -a pdftk -> pdftk is /usr/local/bin/pdftk yes, I am wondering too. first time I use a snap, the examples seemed just so simple...

    – cypherabe
    Jul 26 '18 at 13:18








  • 1





    I don't know why that wouldn't work, however it's a more complicated than it needs to be - the snap is now available as plain pdftk and /snap/bin has been part of the default Ubuntu PATH for some time now - I suggest you remove both the symlink and the pdftk-smoser snap and snap install pdftk instead

    – steeldriver
    Jul 26 '18 at 14:48
















1















following the simple instructions in this answer: https://askubuntu.com/a/1048975 I installed pdftk as a snap on an ubuntu 18.04 VM. (we need some of the advanced features of pdftk on the command line like fill_forms ).



my problem: the command seems to be only half installed:



/some/path # pdftk
-> Usage:
pdftk <command>

Install, configure, refresh and remove snap packages. Snaps are
'universal' packages that work across many different Linux systems,
enabling secure distribution of the latest apps and utilities for
cloud, servers, desktops and the internet of things.

This is the CLI for snapd, a background service that takes care of
snaps on the system. Start with 'snap list' to see installed snaps.

Available commands:
< long list of snap commands >


so it seems to me as if 'pdftk' is registered as a tool in the bash, but if I try to use any of the usual pdftk commands, I get an error message like this:



pdftk forms/Form_FM.pdf fill_form /tmp/adsh/2017-4_1532602497.fdf output /some/path/2017-4_KF.pdf
-> error: unknown command forms/Form_FM.pdf, see 'snap help'


(this also happens with every other command I tried)
so, how do I pass the commands and parameter to pdftk without snap trying to grab the parameter for itself?



edit: some diagnostics:



ls -l /usr/local/bin/pdftk
lrwxrwxrwx 1 root root 28 Jul 11 18:17 /usr/local/bin/pdftk -> /snap/bin/pdftk-smoser.pdftk

snap list pdftk
error: no matching snaps installed

snap list pdftk-smoser
Name Version Rev Tracking Developer Notes
pdftk-smoser 2.02-4 18 stable smoser -


hmmm...seems like I followed the older version of the answer, which had an additional step that symlinked /snap/bin/pdftk-smoser.pdftk to /usr/local/bin/pdftk










share|improve this question

























  • Hi cypherabe! Welcome to askUbuntu! The third argument of your command is /tmp/adsh/2017-4_1532602497.fdf, but it should be /tmp/adsh/2017-4_1532602497.pdf (misspelled pdf)

    – abu_bua
    Jul 26 '18 at 11:46








  • 2





    Hmm... it actually looks like you're getting the usage information for the snap command (but with the command name pdftk), rather than that of the pdftk command itself - I wonder what could have gone wrong? Did you by any chance make a symbolic link?

    – steeldriver
    Jul 26 '18 at 12:02













  • ... can you add the output of type -a pdftk please?

    – steeldriver
    Jul 26 '18 at 12:13











  • @steeldriver type -a pdftk -> pdftk is /usr/local/bin/pdftk yes, I am wondering too. first time I use a snap, the examples seemed just so simple...

    – cypherabe
    Jul 26 '18 at 13:18








  • 1





    I don't know why that wouldn't work, however it's a more complicated than it needs to be - the snap is now available as plain pdftk and /snap/bin has been part of the default Ubuntu PATH for some time now - I suggest you remove both the symlink and the pdftk-smoser snap and snap install pdftk instead

    – steeldriver
    Jul 26 '18 at 14:48














1












1








1








following the simple instructions in this answer: https://askubuntu.com/a/1048975 I installed pdftk as a snap on an ubuntu 18.04 VM. (we need some of the advanced features of pdftk on the command line like fill_forms ).



my problem: the command seems to be only half installed:



/some/path # pdftk
-> Usage:
pdftk <command>

Install, configure, refresh and remove snap packages. Snaps are
'universal' packages that work across many different Linux systems,
enabling secure distribution of the latest apps and utilities for
cloud, servers, desktops and the internet of things.

This is the CLI for snapd, a background service that takes care of
snaps on the system. Start with 'snap list' to see installed snaps.

Available commands:
< long list of snap commands >


so it seems to me as if 'pdftk' is registered as a tool in the bash, but if I try to use any of the usual pdftk commands, I get an error message like this:



pdftk forms/Form_FM.pdf fill_form /tmp/adsh/2017-4_1532602497.fdf output /some/path/2017-4_KF.pdf
-> error: unknown command forms/Form_FM.pdf, see 'snap help'


(this also happens with every other command I tried)
so, how do I pass the commands and parameter to pdftk without snap trying to grab the parameter for itself?



edit: some diagnostics:



ls -l /usr/local/bin/pdftk
lrwxrwxrwx 1 root root 28 Jul 11 18:17 /usr/local/bin/pdftk -> /snap/bin/pdftk-smoser.pdftk

snap list pdftk
error: no matching snaps installed

snap list pdftk-smoser
Name Version Rev Tracking Developer Notes
pdftk-smoser 2.02-4 18 stable smoser -


hmmm...seems like I followed the older version of the answer, which had an additional step that symlinked /snap/bin/pdftk-smoser.pdftk to /usr/local/bin/pdftk










share|improve this question
















following the simple instructions in this answer: https://askubuntu.com/a/1048975 I installed pdftk as a snap on an ubuntu 18.04 VM. (we need some of the advanced features of pdftk on the command line like fill_forms ).



my problem: the command seems to be only half installed:



/some/path # pdftk
-> Usage:
pdftk <command>

Install, configure, refresh and remove snap packages. Snaps are
'universal' packages that work across many different Linux systems,
enabling secure distribution of the latest apps and utilities for
cloud, servers, desktops and the internet of things.

This is the CLI for snapd, a background service that takes care of
snaps on the system. Start with 'snap list' to see installed snaps.

Available commands:
< long list of snap commands >


so it seems to me as if 'pdftk' is registered as a tool in the bash, but if I try to use any of the usual pdftk commands, I get an error message like this:



pdftk forms/Form_FM.pdf fill_form /tmp/adsh/2017-4_1532602497.fdf output /some/path/2017-4_KF.pdf
-> error: unknown command forms/Form_FM.pdf, see 'snap help'


(this also happens with every other command I tried)
so, how do I pass the commands and parameter to pdftk without snap trying to grab the parameter for itself?



edit: some diagnostics:



ls -l /usr/local/bin/pdftk
lrwxrwxrwx 1 root root 28 Jul 11 18:17 /usr/local/bin/pdftk -> /snap/bin/pdftk-smoser.pdftk

snap list pdftk
error: no matching snaps installed

snap list pdftk-smoser
Name Version Rev Tracking Developer Notes
pdftk-smoser 2.02-4 18 stable smoser -


hmmm...seems like I followed the older version of the answer, which had an additional step that symlinked /snap/bin/pdftk-smoser.pdftk to /usr/local/bin/pdftk







command-line snap pdftk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 26 '18 at 13:50







cypherabe

















asked Jul 26 '18 at 11:27









cypherabecypherabe

1165




1165













  • Hi cypherabe! Welcome to askUbuntu! The third argument of your command is /tmp/adsh/2017-4_1532602497.fdf, but it should be /tmp/adsh/2017-4_1532602497.pdf (misspelled pdf)

    – abu_bua
    Jul 26 '18 at 11:46








  • 2





    Hmm... it actually looks like you're getting the usage information for the snap command (but with the command name pdftk), rather than that of the pdftk command itself - I wonder what could have gone wrong? Did you by any chance make a symbolic link?

    – steeldriver
    Jul 26 '18 at 12:02













  • ... can you add the output of type -a pdftk please?

    – steeldriver
    Jul 26 '18 at 12:13











  • @steeldriver type -a pdftk -> pdftk is /usr/local/bin/pdftk yes, I am wondering too. first time I use a snap, the examples seemed just so simple...

    – cypherabe
    Jul 26 '18 at 13:18








  • 1





    I don't know why that wouldn't work, however it's a more complicated than it needs to be - the snap is now available as plain pdftk and /snap/bin has been part of the default Ubuntu PATH for some time now - I suggest you remove both the symlink and the pdftk-smoser snap and snap install pdftk instead

    – steeldriver
    Jul 26 '18 at 14:48



















  • Hi cypherabe! Welcome to askUbuntu! The third argument of your command is /tmp/adsh/2017-4_1532602497.fdf, but it should be /tmp/adsh/2017-4_1532602497.pdf (misspelled pdf)

    – abu_bua
    Jul 26 '18 at 11:46








  • 2





    Hmm... it actually looks like you're getting the usage information for the snap command (but with the command name pdftk), rather than that of the pdftk command itself - I wonder what could have gone wrong? Did you by any chance make a symbolic link?

    – steeldriver
    Jul 26 '18 at 12:02













  • ... can you add the output of type -a pdftk please?

    – steeldriver
    Jul 26 '18 at 12:13











  • @steeldriver type -a pdftk -> pdftk is /usr/local/bin/pdftk yes, I am wondering too. first time I use a snap, the examples seemed just so simple...

    – cypherabe
    Jul 26 '18 at 13:18








  • 1





    I don't know why that wouldn't work, however it's a more complicated than it needs to be - the snap is now available as plain pdftk and /snap/bin has been part of the default Ubuntu PATH for some time now - I suggest you remove both the symlink and the pdftk-smoser snap and snap install pdftk instead

    – steeldriver
    Jul 26 '18 at 14:48

















Hi cypherabe! Welcome to askUbuntu! The third argument of your command is /tmp/adsh/2017-4_1532602497.fdf, but it should be /tmp/adsh/2017-4_1532602497.pdf (misspelled pdf)

– abu_bua
Jul 26 '18 at 11:46







Hi cypherabe! Welcome to askUbuntu! The third argument of your command is /tmp/adsh/2017-4_1532602497.fdf, but it should be /tmp/adsh/2017-4_1532602497.pdf (misspelled pdf)

– abu_bua
Jul 26 '18 at 11:46






2




2





Hmm... it actually looks like you're getting the usage information for the snap command (but with the command name pdftk), rather than that of the pdftk command itself - I wonder what could have gone wrong? Did you by any chance make a symbolic link?

– steeldriver
Jul 26 '18 at 12:02







Hmm... it actually looks like you're getting the usage information for the snap command (but with the command name pdftk), rather than that of the pdftk command itself - I wonder what could have gone wrong? Did you by any chance make a symbolic link?

– steeldriver
Jul 26 '18 at 12:02















... can you add the output of type -a pdftk please?

– steeldriver
Jul 26 '18 at 12:13





... can you add the output of type -a pdftk please?

– steeldriver
Jul 26 '18 at 12:13













@steeldriver type -a pdftk -> pdftk is /usr/local/bin/pdftk yes, I am wondering too. first time I use a snap, the examples seemed just so simple...

– cypherabe
Jul 26 '18 at 13:18







@steeldriver type -a pdftk -> pdftk is /usr/local/bin/pdftk yes, I am wondering too. first time I use a snap, the examples seemed just so simple...

– cypherabe
Jul 26 '18 at 13:18






1




1





I don't know why that wouldn't work, however it's a more complicated than it needs to be - the snap is now available as plain pdftk and /snap/bin has been part of the default Ubuntu PATH for some time now - I suggest you remove both the symlink and the pdftk-smoser snap and snap install pdftk instead

– steeldriver
Jul 26 '18 at 14:48





I don't know why that wouldn't work, however it's a more complicated than it needs to be - the snap is now available as plain pdftk and /snap/bin has been part of the default Ubuntu PATH for some time now - I suggest you remove both the symlink and the pdftk-smoser snap and snap install pdftk instead

– steeldriver
Jul 26 '18 at 14:48










2 Answers
2






active

oldest

votes


















1














As steeldriver suggested, I ended up with removing the symlink, removing the pdftk-smoser snap, then installing the pdftk snap and finally creating a new symlink for /usr/local/bin/pdftk to /snap/bin/pdftk



now a call to pdftk on the commandline brings up the pdftk usage hint, not something snap related



a caveat: I still can't access my pdf files, but at least I get pdftk error messages now. I'm not sure if it is a snap problem, an apparmor problem or a general rights problem...but if I can't find a solution that will be a new question






share|improve this answer
























  • You could also try a fork based of pdftk depending on OpenJDK as described here: askubuntu.com/questions/1028522/… . This worked flawlessly for me.

    – Bruni
    Jul 26 '18 at 15:20






  • 1





    As described in github.com/smoser/pdftk/issues/1 , snap cannot access files in /tmp. The easiest workaround is to copy the files to your home directory and use them from there.

    – smoser
    Sep 5 '18 at 13:15



















0














https://wilransz.com/pdftk-on-ubuntu-18-04/



sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk





share|improve this answer








New contributor




Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1059664%2fpdftk-snap-in-18-04-not-accepting-commands%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    As steeldriver suggested, I ended up with removing the symlink, removing the pdftk-smoser snap, then installing the pdftk snap and finally creating a new symlink for /usr/local/bin/pdftk to /snap/bin/pdftk



    now a call to pdftk on the commandline brings up the pdftk usage hint, not something snap related



    a caveat: I still can't access my pdf files, but at least I get pdftk error messages now. I'm not sure if it is a snap problem, an apparmor problem or a general rights problem...but if I can't find a solution that will be a new question






    share|improve this answer
























    • You could also try a fork based of pdftk depending on OpenJDK as described here: askubuntu.com/questions/1028522/… . This worked flawlessly for me.

      – Bruni
      Jul 26 '18 at 15:20






    • 1





      As described in github.com/smoser/pdftk/issues/1 , snap cannot access files in /tmp. The easiest workaround is to copy the files to your home directory and use them from there.

      – smoser
      Sep 5 '18 at 13:15
















    1














    As steeldriver suggested, I ended up with removing the symlink, removing the pdftk-smoser snap, then installing the pdftk snap and finally creating a new symlink for /usr/local/bin/pdftk to /snap/bin/pdftk



    now a call to pdftk on the commandline brings up the pdftk usage hint, not something snap related



    a caveat: I still can't access my pdf files, but at least I get pdftk error messages now. I'm not sure if it is a snap problem, an apparmor problem or a general rights problem...but if I can't find a solution that will be a new question






    share|improve this answer
























    • You could also try a fork based of pdftk depending on OpenJDK as described here: askubuntu.com/questions/1028522/… . This worked flawlessly for me.

      – Bruni
      Jul 26 '18 at 15:20






    • 1





      As described in github.com/smoser/pdftk/issues/1 , snap cannot access files in /tmp. The easiest workaround is to copy the files to your home directory and use them from there.

      – smoser
      Sep 5 '18 at 13:15














    1












    1








    1







    As steeldriver suggested, I ended up with removing the symlink, removing the pdftk-smoser snap, then installing the pdftk snap and finally creating a new symlink for /usr/local/bin/pdftk to /snap/bin/pdftk



    now a call to pdftk on the commandline brings up the pdftk usage hint, not something snap related



    a caveat: I still can't access my pdf files, but at least I get pdftk error messages now. I'm not sure if it is a snap problem, an apparmor problem or a general rights problem...but if I can't find a solution that will be a new question






    share|improve this answer













    As steeldriver suggested, I ended up with removing the symlink, removing the pdftk-smoser snap, then installing the pdftk snap and finally creating a new symlink for /usr/local/bin/pdftk to /snap/bin/pdftk



    now a call to pdftk on the commandline brings up the pdftk usage hint, not something snap related



    a caveat: I still can't access my pdf files, but at least I get pdftk error messages now. I'm not sure if it is a snap problem, an apparmor problem or a general rights problem...but if I can't find a solution that will be a new question







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 26 '18 at 15:15









    cypherabecypherabe

    1165




    1165













    • You could also try a fork based of pdftk depending on OpenJDK as described here: askubuntu.com/questions/1028522/… . This worked flawlessly for me.

      – Bruni
      Jul 26 '18 at 15:20






    • 1





      As described in github.com/smoser/pdftk/issues/1 , snap cannot access files in /tmp. The easiest workaround is to copy the files to your home directory and use them from there.

      – smoser
      Sep 5 '18 at 13:15



















    • You could also try a fork based of pdftk depending on OpenJDK as described here: askubuntu.com/questions/1028522/… . This worked flawlessly for me.

      – Bruni
      Jul 26 '18 at 15:20






    • 1





      As described in github.com/smoser/pdftk/issues/1 , snap cannot access files in /tmp. The easiest workaround is to copy the files to your home directory and use them from there.

      – smoser
      Sep 5 '18 at 13:15

















    You could also try a fork based of pdftk depending on OpenJDK as described here: askubuntu.com/questions/1028522/… . This worked flawlessly for me.

    – Bruni
    Jul 26 '18 at 15:20





    You could also try a fork based of pdftk depending on OpenJDK as described here: askubuntu.com/questions/1028522/… . This worked flawlessly for me.

    – Bruni
    Jul 26 '18 at 15:20




    1




    1





    As described in github.com/smoser/pdftk/issues/1 , snap cannot access files in /tmp. The easiest workaround is to copy the files to your home directory and use them from there.

    – smoser
    Sep 5 '18 at 13:15





    As described in github.com/smoser/pdftk/issues/1 , snap cannot access files in /tmp. The easiest workaround is to copy the files to your home directory and use them from there.

    – smoser
    Sep 5 '18 at 13:15













    0














    https://wilransz.com/pdftk-on-ubuntu-18-04/



    sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk





    share|improve this answer








    New contributor




    Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      https://wilransz.com/pdftk-on-ubuntu-18-04/



      sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk





      share|improve this answer








      New contributor




      Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        https://wilransz.com/pdftk-on-ubuntu-18-04/



        sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk





        share|improve this answer








        New contributor




        Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        https://wilransz.com/pdftk-on-ubuntu-18-04/



        sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk






        share|improve this answer








        New contributor




        Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 19 mins ago









        GuestGuest

        1




        1




        New contributor




        Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Guest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1059664%2fpdftk-snap-in-18-04-not-accepting-commands%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            GameSpot

            日野市

            Tu-95轟炸機