Open thinkpanzer opened 1 year ago
When trying to run
sudo dietpi-updater
manually, sudo returnssudo: dietpi-updater: command not found
The following should work:
sudo dietpi-update
Sorry, the original string was a transcription error on my part.
sudo dietpi-update
generates the error, and the root cause/fix was because /boot/dietpi
was not part of secure_path
in /etc/sudoers
. I have changed my default login shell to zsh and made a few other customizations, so I'll retry on a newly installed image to see if I can understand why it apparently works on a fresh system. Thanks.
Ah, this is because zsh does not load the dietpi-*
aliases from /etc/bashrc.d/dietpi.bash
. The scripts are not added to PATH
but added as alias. Furthermore, sudo
itself cannot make use of aliases via sudo <alias>
, but only if it is made an alias of itself.
If I remember right, it generally works wo source
this script in zsh, but some of the G_*
functions won't work correctly, e.g. since zsh counts array indices from 1 up instead of 0, right? But the aliases, login banner and autostart options should work that way.
Generally support for other shells is tracked here: #6118
Creating a bug report/issue
Required Information
DietPi version G_DIETPI_VERSION_CORE=8 G_DIETPI_VERSION_SUB=16 G_DIETPI_VERSION_RC=2 G_GITBRANCH='beta' G_GITOWNER='MichaIng'
Distro version
returns null
Linux 5.10.110 #1 SMP Tue Mar 14 21:59:07 CST 2023 aarch64 GNU/Linux
NanoPi R6S
Additional Information (if applicable)
Yes
Steps to reproduce
dietpi-update
as an unprivileged user returns[FAILED] DietPi-Update | Root privileges required. Please run the command with "sudo" or "G_SUDO".
/etc/sudoers
does not include/boot/dietpi
insecure_path
sudo dietpi-updater
manually, sudo returnssudo: dietpi-updater: command not found
Expected behaviour
Extra details
/boot/dietpi
as a default part ofsecure_path
in/etc/sudoers
so I'm not going to propose simply adding it, mainly because I don't know if the DietPi developers consider/boot/dietpi
to be a secure and trustable path. If not, then adding it tosecure_path
is probably not a good idea. If this is the case, the error messages should be updated.Thanks!