• Endymion_Mallorn
    link
    fedilink
    -314 days ago

    Um… shouldn’t it be:

    sudo su;
    apt-get update;
    flatpak update;
    

    Or am I missing something?

    • @dunz@feddit.nu
      link
      fedilink
      16
      edit-2
      13 days ago

      Use sudo -i instead, gives you an interactive shell without running the su binary with sudo, which is unnecessary

      Edit: it’s i not I

      • Endymion_Mallorn
        link
        fedilink
        214 days ago

        Thank you, that’s a switch I hadn’t looked at. I’ll admit though, I’m on Mint, I have a nice built-in GUI that works nicely.

        • Snot Flickerman
          link
          fedilink
          English
          4
          edit-2
          13 days ago

          It’s a really important switch for doing things like setting up wireguard, which has protected directories, you can’t actually enter the directory for wireguard setup without sudo -i

          (I mean technically you probably can with sudo su, too, but this is more elegant and less redundant)

    • @Geodad@lemm.ee
      link
      fedilink
      English
      13
      edit-2
      13 days ago

      You should never use “sudo su”. That’s a big security no-no.

      ~$ sudo apt update

      [sudo] password for {your user name}:

      -command executes-

      ~$

      • Endymion_Mallorn
        link
        fedilink
        113 days ago

        Does that1 security no-no matter on a single-user system which (almost) never leaves the sight of said user? Or is that just a matter of ‘don’t do this on a server’?

        • @Geodad@lemm.ee
          link
          fedilink
          English
          413 days ago

          It’s not a good habit to get into. Even if you don’t have anyone at homebto mess with your system, these kinds of habits tend to follow people around. You’ll get comfortable at work and run something as root, but forget to deescalate permissions.

          Just using sudo as your user runs only that command or script as root, then drops back to your limited user account.

          Say you got busy or distracted and walked away, anyone who was able to access your system between the end of the command and the time your system auto locked would only have the access level of your user.

    • @aleq@lemmy.world
      link
      fedilink
      413 days ago

      What’s the problem exactly? There are many ways to do it, and I think saying you run apt-get update is quite fine even if you’re not explicitly saying that you run it as root. And he may not have flatpaks.

    • Snot Flickerman
      link
      fedilink
      English
      414 days ago

      There’s also

      sudo apt update

      if you only want to apply the superuser permission one specific command instead of a lot of commands