0

I just tried converting several different images into a PDF file using the 'convert' command in a terminal, but when I did so, it returned:

convert.im6: Unable to open image 'xxx.pdf': Permission denied @ error/blob.c/OpenBlob/2638

where 'xxx.pdf' represents my output PDF file name. Of course, if I do it as root -- that is to say, sudo convert -- the operation goes through without a hitch. So my question, since I know some of you might probably say I'm an idiot for not thinking about doing the sudo act, is: Why is the convert command only available for root, instead of regular users? And is there any way I can change that?

  • How did you install ImageMagick and Ghostscript? Are you working on a read only mounted drive? – Takkat Aug 28 '14 at 10:20
3

Your suggestion is incorrect. Convert is available for all users.

If you're converting into a PDF and you're seeing Unable to open image 'xxx.pdf', the program has tried to open xxx.pdf for writing and has been rebuffed by the Kernel because the current user can't write to that file. There are a couple of reasons:

  • The current $USER can't write to the current directory. Try touch testfile and if that fails look at the directory permissions with stat .. To fix, either go to a directory where you can write, change the directory's permissions to allow $USER to write or change your user (eg add it to the right group) to allow it to write.

    There are various ACL options on top of this but it's most likely you're just in a root-controlled directory in which case just go somewhere else.

  • There's already a file called xxx.pdf and it's owned by somebody else and $USER doesn't have write permission for it. Either sudo chown $USER: xxx.pdf (the : is not a typo), delete it and generate a new version from your $USER.

Both of these could be true at the same time.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.