How can i prevent the super use privileges message from showing

539

Solution 1

The message is throwned by the flutter command itself upon detection of root and cannot be disabled by any means.

As stated in this question you have to install flutter in your user folder to get rid of the "annoying" message (but then, you won't be root).

Solution 2

Flutter just says running flutter as the root user is not a good idea. As, all its future plugin installations etc might be needing root privileges. So, give your current user the permission to r/w the flutter folder. The warning will disappear.

sudo chown -R $USER /the/exact/path/of/your/flutter/repo/

This worked for me.

Share:
539
Fethi
Author by

Fethi

i don't rest till that problem is solved

Updated on December 12, 2022

Comments

  • Fethi
    Fethi 11 months

    I'm running flutter on Linux as root and each time i run a flutter command it shows the super user warning message every time i know it shows for other commands as well not just flutter commands so i don't want to show only for flutter commands other it is ok, any help!

    • Muldec
      Muldec over 4 years
      Are your talking about the "To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details." message ?
    • Fethi
      Fethi over 4 years
      no this one Woah! You appear to be trying to run flutter as root. We strongly recommend running the flutter tool without superuser privileges.
    • Muldec
      Muldec over 4 years
      Where did you install flutter ? (in which folder)
    • Fethi
      Fethi over 4 years
      in the Root folder
  • Fethi
    Fethi over 4 years
    thanks but i already know that, i'm just looking for a way to disable it for root, i don't want to switch to another user
  • Muldec
    Muldec over 4 years
    The message is throwned by the flutter tool itself. There's no way to disable it
  • Fethi
    Fethi over 4 years
    oh really, are you sure ?
  • Muldec
    Muldec over 4 years
    Yep. Line 154 of the flutter command