Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Globals | Wrong "sudo" info for dietpi-* aliases: Was fixed with v6.23 #2810

Closed
Sopor opened this issue May 16, 2019 · 7 comments
Closed
Labels
Known Issue 🐛 Solution available 🥂 Definite solution has been done
Milestone

Comments

@Sopor
Copy link

Sopor commented May 16, 2019

Creating a bug report/issue

Required Information

  • G_DIETPI_VERSION_CORE=6
    G_DIETPI_VERSION_SUB=22
    G_DIETPI_VERSION_RC=3
    G_GITBRANCH=master
    G_GITOWNER=MichaIng

  • Distro version | 9.9

  • Kernel version | Linux dietpi 4.14.98-v7+ Request | RT Kernel option #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

  • SBC device | RPi 3 Model B+ (armv7l)

  • Power supply used | 5V 2.4A

  • SDcard used | None

  • USB | Kingston A400 SSD with external power

Steps to reproduce

I noticed a message today about updating DietPi dietpi-update : Run now to update DietPi from v6.22.3 to v6.24.0. so i ran first dietpi-update but then i got a message that i should use sudo -s dietpi-update so i did that too.

Expected behaviour

I assume it should start to update DietPi?

Actual behaviour

Instead i got this message

xxxxx@dietpi:~ $ dietpi-update
[FAILED] DietPi-Update | Root privileges required. Please run the command with "G_SUDO", or, "sudo -s".
xxxxx@dietpi:~ $ sudo -s dietpi-update
[sudo] password for xxxxx:
/bin/bash: dietpi-update: command not found
xxxxx@dietpi:~ $
@UNiXMIT
Copy link

UNiXMIT commented May 17, 2019

Try running the script with the full path:

sudo /DietPi/dietpi/dietpi-update

@Sopor
Copy link
Author

Sopor commented May 17, 2019

If full path is needed the help text should includes that information instead of only showing this text:

[FAILED] DietPi-Update | Root privileges required. Please run the command with "G_SUDO", or, "sudo -s".

@UNiXMIT
Copy link

UNiXMIT commented May 17, 2019

Did it help though? It's not usually needed.
I've just tried it and yes sudo -s dietpi-update returns that error. Try it without the -s and it should work fine.

@Sopor
Copy link
Author

Sopor commented May 17, 2019

But the instructions say sudo -s so i did use what it tells me to do. The -s (runs a shell with root privileges) is added for some reasons or else it could be left out.

@MichaIng
Copy link
Owner

@Sopor @UNiXMIT
Jep the "-s" is not correct here. The info was changed with v6.23.

Please simply do: sudo dietpi-update

@MichaIng MichaIng added this to the v6.23 milestone May 17, 2019
@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label May 17, 2019
@MichaIng MichaIng changed the title /bin/bash: dietpi-update: command not found DietPi-Globals | Wrong "sudo" info for dietpi-* aliases: Was fixed with v6.23 May 17, 2019
@UNiXMIT
Copy link

UNiXMIT commented May 17, 2019

Ah yes it has changed in 6.23. Great.

@MichaIng
Copy link
Owner

MichaIng commented May 17, 2019

Ref: https://github.com/MichaIng/DietPi/blob/master/dietpi/func/dietpi-globals#L456

Root privileges required. Please run the command with "sudo" or "G_SUDO".

Sidenote:

  • sudo alone works for "aliases", which includes the dietpi-* commands.
  • G_SUDO is required for global functions (the G_* commands, e.g. G_CHECK_URL https://dietpi.com, G_AGUP, ...). It assures that the dietpi-globals script (which defines the functions, as above link) is fully loaded before the G_* command is attempted to run. Usually the script is loaded with sudo -s, but since it requires a little while to load, in most cases the G_* command is attempted to run before it has been loaded. So we load it actively and run the function afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Known Issue 🐛 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

3 participants