Windows 11 update this week, and after that whenever I try to start wsl I get the following error:
-bash: groups: command not found
Command 'grep' is available in the following places
- /bin/grep
- /usr/bin/grep
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
grep: command not found
Command 'id' is available in the following places
- /bin/id
- /usr/bin/id
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
id: command not found
-bash: [: -eq: unary operator expected
Command 'update-motd' is available in the following places
- /sbin/update-motd
- /usr/sbin/update-motd
The command could not be located because '/usr/sbin:/sbin' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative privileges associated with your user account.update-motd: command not found
This message is shown once a day. To disable it please create the
/root/.hushlogin file.
Command 'touch' is available in the following places
- /bin/touch
- /usr/bin/touch
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
touch: command not found
To troubleshoot, I tried the following:
wsl --update
I added /bin:/usr/bin to the .bashrc and I get the same error.
As a workaround to start wsl, I added a .sh script in the /etc/profile.d/ directory adding /bin:/usr/bin to the $PATH and now wsl starts with just the following error message:
-bash: groups: command not found
I tried installing another distribution of Ubuntu: Ubuntu-24.04.
But after the installation, I am asked to enter a username after getting the following error:
/bin/bash: line 1: rm: command not found
Please create a default UNIX user account. The username does not need to match your Windows username.
And when I add the username, I get:
/bin/bash: line 1: adduser: command not found
Bottom line is, it seems that wsl is not recognizing /bin:/usr/bin in the $PATH environment variable despite of being there.