Skip to content

Commit a29a5c9

Browse files
authored
code sample for 'append $PATH during the assignment like below' (#1008)
1 parent ab28c2c commit a29a5c9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

WSL/troubleshooting.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ fi
110110
The correct way on Debian is to remove above lines.
111111
You may also append $PATH during the assignment like below, but this lead to some [other problems](https://salsa.debian.org/debian/WSL/-/commit/7611edba482fd0b3f67143aa0fc1e2cc1d4100a6) with WSL and VSCode..
112112

113+
```Bash
114+
if [ "`id -u`" -eq 0 ]; then
115+
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
116+
else
117+
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:$PATH"
118+
fi
119+
```
120+
113121
For more information, see issue [5296](https://github.com/microsoft/WSL/issues/5296) and issue [5779](https://github.com/microsoft/WSL/issues/5779).
114122

115123
### "Error: 0x80370102 The virtual machine could not be started because a required feature is not installed."

0 commit comments

Comments
 (0)