Update Documentation - Unable to run commands using sudo - Raspberry Pi #513
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#513
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
orsudo 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:
Unable to run commands using sudo - Raspberry Pito Update Documentation - Unable to run commands using sudo - Raspberry PiI'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!
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.
Added to the documentation! Thanks!