This answer gives you a detailed account of what you need to do. To overcome the restrictions, there are two possibilities:
Remove the policy file all together. Easy to do with a single rm
(remove) command, but not secure at all. Thus not preferred.
Editing the policy file to only enable PDF operations. Indeed, prefer to take this approach.
To edit the file, you need to open it in a text editor with root (administrator) privileges. There are multiple ways to do that. To make editing as easy as possible, you may want to open the system file in your graphical text editor, gedit
in the standard Ubuntu desktop:
env EDITOR=gedit sudoedit /etc/ImageMagick-6/policy.xml
If you can work with the standard terminal based editor nano
, then the command simplifies to:
sudoedit /etc/ImageMagick-6/policy.xml
This opens the file in the standard terminal editor, nano
on Ubuntu.
The command you attempted yourself just specifies sudo
. This command should be followed by another command. sudo
will then run that other command with elevated privileges (administrator or root privileges, required to change system files). will run a command following it, which will elevate the following command to root permissions. However, instead of providing a command, you provided the file name. Thus, sudo
attempts to run that file as an executable, but that fails because it is not an executable. A way that would have worked, but which is less recommended for security, would be:
sudo nano /etc/ImageMagick-6/policy.xml
The previous commands that use sudoedit
are preferred because more secure: the command will copy the system file to a temporary file that can be edited with a normal editor. When saving the file, the system file is updated with the content of the temporary file