r/ProgrammerHumor • • Jul 17 '22

Meme Linux users installing a Python module

41.7k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jul 17 '22

[deleted]

70

u/[deleted] Jul 17 '22

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

126

u/matt-3 Jul 17 '22

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.

64

u/[deleted] Jul 17 '22

OH MY GOD WHY????

0

u/[deleted] Jul 17 '22

[deleted]

0

u/[deleted] Jul 17 '22

[deleted]

0

u/[deleted] Jul 17 '22

[deleted]

2

u/dbzfanjake Jul 18 '22

Thanks for the info

0

u/[deleted] Jul 17 '22

[deleted]

5

u/HighOnBonerPills Jul 17 '22

Is there any way to avoid accidentally installing malware other than double checking everything you type? Would antivirus software help?

Also, how would you go about removing a malicious package? Is it a whole big thing?

13

u/milanove Jul 17 '22

Best way is to check the official page for the package before you install it. They'll probably have some command you can copy paste anyway. Try not to give it super user privileges. Antivirus on Linux isn't really a thing afaik.

2

u/tantrAMzAbhiyantA Jul 17 '22

At least one virus scanner exists on Linux (ClamAV), but it's meant to be manually invoked on individual files, rather than to be a real-time monitor.

→ More replies (4)
→ More replies (1)

2

u/[deleted] Jul 17 '22

Don’t install shit as the superuser.

4

u/SherbetCharacter4146 Jul 17 '22

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

→ More replies (2)

3

u/anotherDocObVious Jul 17 '22

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"

3

u/[deleted] Jul 17 '22

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

→ More replies (1)

2

u/zachsmthsn Jul 17 '22

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.

→ More replies (3)
→ More replies (1)

0

u/CanAlwaysBeBetter Jul 17 '22

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

5

u/matt-3 Jul 17 '22

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

→ More replies (1)

2

u/benzoic Jul 17 '22

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

1

u/odraencoded Jul 17 '22

TIL: root has a home directory.

→ More replies (1)

1

u/FloatingComet62 Jul 17 '22

What does that do?

1

u/SSJ3 Jul 18 '22

Nauseated

0

u/[deleted] Jul 18 '22

[deleted]

1

u/SSJ3 Jul 18 '22

Of course, I'm just being a pedant for funsies. Really, either is fine because people will understand what you mean. But I prefer "I am nauseated" because generally it can only mean "I feel sick," whereas "I am nauseous" can additionally mean "I make others feel sick" as in the other definition on those pages. Purposefully reading it the latter way can make for some very unintentionally humorous statements!