Use sudo -H instead of sudo on Readme to avoid ruin the permissions of the pip cache folder #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Assuming that I am a regular Linux user named
luzfcb
, with the HOME folder located in/home/luzfcb
and the$HOME
environment variable pointing to/home/luzfcb
sudo
without-H
modifier will run the command withroot
permissions, but using the$HOME
environment variable of the current user ( not theroot
)pip
will use the$HOME
environment variable to create a cache directory on/home/luzfcb/.cache/pip/
, but all new files/directories will be created withroot
permission, and root-only read permission; that is, theluzfcb
user has nowrite
orread
permission to some of the directories inside/home/luzfcb/.cache/pip/
.sudo
with the-H
modifier will run the command withroot
permissions and use theroot
user's$HOME
environment variable instead of the current user's$HOME
.So, if we use
sudo
with the-H
modifier to runpip
, thepip
will use the$HOME
environment variable of the root user to create a cache directory on/root/.cache/pip/
, and all future sufferings will be avoided :-) .Another option, to not use
sudo
with-H
, is usepip
with--no-cache-dir
Description
This pull-request adds the
-H
modifier thesudo
when it is used thepip
on the Readme