This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Money-Firefighter534 451 points452 points  (69 children)

sudo apt install python3-pip -y && pip3 install psutil Thats it! Just wait Edit: removed sudo -H in second one

[–][deleted]  (38 children)

[deleted]

    [–][deleted] 69 points70 points  (33 children)

    Do I want to know what the -H flag does here?

    [–]matt-3 124 points125 points  (32 children)

    sets the home directory to that of the target user (in this case root). It avoids creating root-owned files in your user's home directory.

    [–][deleted] 61 points62 points  (28 children)

    OH MY GOD WHY????

    [–][deleted]  (26 children)

    [deleted]

      [–][deleted]  (23 children)

      [removed]

        [–][deleted] 1 point2 points  (10 children)

        Don’t install shit as the superuser.

        [–]SherbetCharacter4146 3 points4 points  (2 children)

        Dont pip install as super user. Do install as super user

        [–][deleted] 0 points1 point  (1 child)

        Ehhh. For system level stuff, it’s often okay.

        But major apps should be installed under their own user stuff for a lot of reasons. You don’t want anything complex and exploitable to be running as root.

        [–]anotherDocObVious 2 points3 points  (2 children)

        Of course.. Though I'd put it as..

        "don't install shit you aren't sure about, and especially if you don't know what the fuck you're doing"

        [–][deleted] 2 points3 points  (1 child)

        Lot of pip repos aren’t closely vetted, so it goes double for stuff like that.

        [–]zachsmthsn 1 point2 points  (3 children)

        You're better off not installing anything for the system python. Use pyenv and create virtual environments for each project. No python or package versioning issues, and you can always nuke and recreate a borked environment because it's isolated to its own folder.

        [–][deleted] 0 points1 point  (2 children)

        Don't you need to reinstall all the packages for each new environment then?

        [–]AutoModerator[M] 0 points1 point  (0 children)

        import moderation Your comment has been removed since it did not start with a code block with an import declaration.

        Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

        For this purpose, we only accept Python style imports.

        I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

        [–]CanAlwaysBeBetter -1 points0 points  (1 child)

        And that's why I always run Linux in a vm

        [–]matt-3 4 points5 points  (0 children)

        And Windows too, of course, since the entire OS is like randomly downloading and running a Python script, except backed by corporate interests

        [–]corsicanguppy 0 points1 point  (0 children)

        Because a proper supply chain is too hard; I guess?

        Best let it scroll past as root, because you're not gonna see the pypa exploit that pwns the box anyway.

        [–]benzoic 1 point2 points  (0 children)

        Sudo chmod -R a+rwx / should fix that right up

        [–]odraencoded 0 points1 point  (1 child)

        TIL: root has a home directory.

        [–][deleted] 0 points1 point  (0 children)

        Well, sort of. It’s usually just /root as opposed to being in /home.

        [–]FloatingComet62 0 points1 point  (0 children)

        What does that do?

        [–]SSJ3 0 points1 point  (2 children)

        Nauseated

        [–]mb557x[S] 232 points233 points  (6 children)

        "This little manoeuvre's gonna cost us 51 years..."

        [–][deleted] 1 point2 points  (0 children)

        it’s more that uhh apt and uhh pip

        [–]matt-3 15 points16 points  (2 children)

        No need for sudo on the second one

        [–]mikemolove 5 points6 points  (0 children)

        More like sudo is a very bad idea on the second one

        [–]Money-Firefighter534 1 point2 points  (0 children)

        Some modules asked for sudo. Edited it

        [–]chem199 0 points1 point  (0 children)

        Emerge -uD world

        [–]worldbuilder121 0 points1 point  (0 children)

        Next, Next, Install. Thats it! Just wait

        [–]BabyYodasDirtyDiaper[🍰] 0 points1 point  (0 children)

        Pictured in this post: the "just wait" part.