0

I use a mac at work, which has /etc/paths to add paths, with the syntax:

/usr/foo

/usr/bar

Using wsl with ubuntu-18.04-ls, I wanted to add "/home/linuxbrew/.linuxbrew/bin" to etc/environment, because I read that is the equivalent of /etc/paths. Changed the line from: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

to

PATH="/home/linuxbrew/.linuxbrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games",restarted, typed echo $PATH but it would still print the old line. Am I in the wrong spot for setting paths globally or did I do something wrong?

K7AAY
  • 17,202
  • yes, as written I did –  Feb 27 '20 at 23:13
  • How did you change the file? are you sure your changes were successfully saved? What do you see now if you cat /etc/environment? – steeldriver Feb 27 '20 at 23:51
  • Which version of WSL are you using? See https://askubuntu.com/a/1177730/197910 – K7AAY Feb 27 '20 at 23:59
  • Just a thought... Why do you want to add a directory, specific to the linuxbrew user, to PATH globally? A more natural place to achieve your goal might be to edit /home/linuxbrew/.profile. – Gunnar Hjalmarsson Feb 27 '20 at 23:59
  • Using WSL 2. Linuxbrew stated it is not in my PATH. Hence, I want to add it to my PATH. The other options I found would to add it to specific shells or profiles, which I would have to do separately for every shell or profile, from what I understood. I should be able to do it via Windows, but I want to get it working directly in Ubuntu. –  Feb 28 '20 at 00:10
  • cat /etc/environment prints like this PATH="/home/linuxbrew/.linuxbrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" –  Feb 28 '20 at 10:54

0 Answers0