Update Documentation - Unable to run commands using sudo - Raspberry Pi #513

Closed
opened 2022-03-29 04:38:29 +00:00 by R0cketM0nster · 3 comments

What I'm trying to do and why

Trying to run sudo borgmatic --version after install to confirm installation completed successfully

Steps to reproduce (if a bug)

run sudo borgmatic --version

Actual behavior (if a bug)

sudo: borgmatic: command not found

Expected behavior (if a bug)

Output version of borgmatic

Other notes / implementation ideas

Environment

borgmatic version: [1.5.24]

Use sudo borgmatic --version or sudo pip show borgmatic | grep ^Version

borgmatic installation method: [Debian - "sudo pip3 install --user --upgrade borgmatic"]

Borg version: [borg 1.1.16]

Use sudo borg --version

Python version: [Python 3.9.2]

Use python3 --version

operating system and version: [Debian GNU/Linux 11 (bullseye)]

The fix for this is to add the path to the sudo path, as per the answer here - https://askubuntu.com/questions/611528/why-cant-sudo-find-a-command-after-i-added-it-to-path

Run the following command - sudo visudo

Add the path "/root/.local/bin" as below:

image

#### What I'm trying to do and why Trying to run sudo borgmatic --version after install to confirm installation completed successfully #### Steps to reproduce (if a bug) run sudo borgmatic --version #### Actual behavior (if a bug) sudo: borgmatic: command not found #### Expected behavior (if a bug) Output version of borgmatic #### Other notes / implementation ideas #### Environment **borgmatic version:** [1.5.24] Use `sudo borgmatic --version` or `sudo pip show borgmatic | grep ^Version` **borgmatic installation method:** [Debian - "sudo pip3 install --user --upgrade borgmatic"] **Borg version:** [borg 1.1.16] Use `sudo borg --version` **Python version:** [Python 3.9.2] Use `python3 --version` **operating system and version:** [Debian GNU/Linux 11 (bullseye)] The fix for this is to add the path to the sudo path, as per the answer here - https://askubuntu.com/questions/611528/why-cant-sudo-find-a-command-after-i-added-it-to-path Run the following command - sudo visudo Add the path "/root/.local/bin" as below: ![image](/attachments/4bcad0a2-fae0-434c-acd8-7654b4143647)
9.9 KiB
R0cketM0nster changed title from Unable to run commands using sudo - Raspberry Pi to Update Documentation - Unable to run commands using sudo - Raspberry Pi 2022-03-29 04:41:03 +00:00
Owner

I've never used sudo's secure_path before, but I'm guessing it only takes effect once you've saved the file (which I assume you've done). And it's probably unrelated to this issue, but it looks like you've got a typo in that value.. /bini should be /bin.

I'm not sure what might be going on with the path though. One thing you could try is the alternate path setting approach documented here, instead of visudo's approach: https://torsion.org/borgmatic/docs/how-to/set-up-backups/#installation

If that still doesn't work, then you are always welcome to switch to the global install option described here: https://torsion.org/borgmatic/docs/how-to/set-up-backups/#global-install-option

That option is much less likely to have path issues because it uses global system paths.

Let me know what you find out!

I've never used sudo's `secure_path` before, but I'm guessing it only takes effect once you've saved the file (which I assume you've done). And it's probably unrelated to this issue, but it looks like you've got a typo in that value.. `/bini` should be `/bin`. I'm not sure what might be going on with the path though. One thing you could try is the alternate path setting approach documented here, instead of visudo's approach: https://torsion.org/borgmatic/docs/how-to/set-up-backups/#installation If that *still* doesn't work, then you are always welcome to switch to the global install option described here: https://torsion.org/borgmatic/docs/how-to/set-up-backups/#global-install-option That option is much less likely to have path issues because it uses global system paths. Let me know what you find out!
witten added the
question / support
label 2022-03-29 04:53:20 +00:00
Author

Apologies, yes the typo was just in making the original post, the path is correct in my .bashrc file.

This was just to get a note added to the documentation you have referenced, I followed the documentation to add the path to my $PATH and .bashrc file, but this didn't work.

After adding the path to secure_path I can now run the borgmatic commands using sudo. I thought this method could be added as an alternative to the global install method.

Apologies, yes the typo was just in making the original post, the path is correct in my .bashrc file. This was just to get a note added to the documentation you have referenced, I followed the documentation to add the path to my $PATH and .bashrc file, but this didn't work. After adding the path to secure_path I can now run the borgmatic commands using sudo. I thought this method could be added as an alternative to the global install method.
Owner

Added to the documentation! Thanks!

Added to the documentation! Thanks!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#513
No description provided.