-2

I get the following error when i enter the command:

printf '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf -q $*' > /usr/bin/newwkhtmltopdf.sh

bash: /usr/bin/newwkhtmltopdf.sh: Permission denied.

I have tried the apt update and even when to the ubuntu packages platform to download the wkhtmlopdf package. Please can someone help me with this??

Jos
  • 30,529
  • 8
  • 89
  • 96

1 Answers1

1

The folder /usr/bin is owned by the root user (UID 0).

You need to have root privileges to write anything to this folder.

Writing to system folders should be done with much care. One way to do this would be to switch to the root user, using the command:

sudo -s

And then running your command. Afterwards, exit to switch back to your normal user.

Another option would be to place your user script inside the $HOME folder, as @Jos state in his comment.

Artur Meinild
  • 31,035