Score:-2

Bash Permission denied error

dk flag

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??

uz flag
Jos
As a regular user you are not allowed to write to `/usr/bin`. If your new script must reside in `/usr/bin` (e.g. because other users need it), use `sudo`. Otherwise, create the script in your `$HOME`.
pLumo avatar
in flag
Please tell us what you're trying to do and why. Where did you read about this? As a user without prior knowledge to Linux, this is not one of the first tasks to do...
Score:1
vn flag

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.

Koji_422 avatar
dk flag
Can you please tell me how to do that? i have no prior knowledge in Ubuntu and related operations. I'll be pleased if you could give me some hints to follow inorder to get htese priviledges
Koji_422 avatar
dk flag
Thanks i did solve my problem using the command sudo -i to enable root priviledges thanks miuch
HuHa avatar
es flag
Since you write you have no prior knowledge in Ubuntu, you are probably about to shoot yourself in the foot. Those permissions are restrictive for a reason. Please learn about the system first before you attempt to modify system files and directories; work in your home directory instead, then any damage you can cause will be limited.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.