Skip to content

Using user-space packages with sudo #26

Answered by ryan4yin
suimong asked this question in Q&A
Discussion options

You must be logged in to vote

Good question, let me explain it.
If you switch to another user, the packages installed by the current user will be unavailable:

# kubectl is available
› kubectl | head
kubectl controls the Kubernetes cluster manager.

 Find more information at: https://kubernetes.io/docs/reference/kubectl/
......

# switch user to `root`
› sudo su

# kubectl is no longer available
> kubectl                                                                                                                                                               08/17/2023 10:32:20 PM
Error: nu::shell::external_command

  × External command failed
   ╭─[entry #1:1:1]
 1 │ kubectl
   · ───┬───
   ·    ╰── executable was n…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@suimong
Comment options

Answer selected by suimong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
good first issue Good for newcomers
2 participants