question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC Avoiding to install as root on Linux

See original GitHub issue

The first line of the installation docs says,

Meson is available in the Python Package Index and can be installed with sudo pip3 install meson which requires root

Installing packages as root from PyPi is practice that’s very much frowned upon, and the solution is often to use virtualenvs rather that using sudo. Sources:

It’s more or less arbitrary code execution as root. So IMO it might be better not to have this as the recommended installation option for unaware users.

In addition from that sentence it’s not clear if it’s only sudo that requires root (and user is free to install it as non root in a virtualenv) or if meson install additionally does something that requires root, and it needs to be installed as root in any case. This question is answered a few paragraphs below but still.

I can make a PR to improve the documentation if useful.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eli-schwartzcommented, Aug 4, 2021

“install it” can be read as “install Meson” or “install Python 3”. I hope it’s the former, because that’s much better practice than sudo pip install. But the sentence after it makes it look like it’s “install Python 3”.

It was certainly intended to be the former. I hadn’t thought before now of it being interpreted as the latter.

1reaction
rthcommented, Aug 4, 2021

the install docs continue on to say “Only use a user copy of Meson if you do not care about installing projects as root.”

Yes, it does indeed, but at the very end. Most users probably never get there (I didn’t at first), they just run the command they encounter in the first sentence. I’ll open a PR to see if the formulation could be improved a bit to avoid this confusion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I avoid su-ing to root - Ask Ubuntu
Just use 'sudo' before the commands. This only assumes root privileges for that command and is the safe way of doing it.
Read more >
4.2. Controlling Root Access Red Hat Enterprise Linux 7
To prevent users from logging in directly as root , the system administrator can set the root account's shell to /sbin/nologin in the...
Read more >
Installing ROOT - ROOT
We distribute pre-compiled ROOT for several major Linux distributions as well as MacOS and (as a beta) Windows. The steps to install a...
Read more >
RootSudo - Community Help Wiki
This means that in the terminal you should use sudo for commands that require root privileges; simply prepend sudo to all the commands...
Read more >
How to fix npm throwing error without sudo - Stack Overflow
Now npm link , npm install -g will no longer require you to be root. Edit: See also https://docs.npmjs.com/getting-started/fixing-npm-permissions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found