How to solve "wsl is not in the sudoers file" on Ubuntu 24.04
Sometimes after change your Ubuntu WSL version, you will see this message:
wsl is not in the sudoers file
So, how to solve this:
First step - On PowerShell terminal, type this command:
wsl --list --verbose
Then you will go to identify the correct name of your disto. See:
PS C:\Users\uaigeek> wsl --list --verbose
NAME STATE VERSION}
* Ubuntu Stopped 2
Ubuntu-20.04 Stopped 2
Ubuntu-24.04 Stopped 2
On my case, the distro is Ubuntu 24.04, then the name is "Ubuntu-24.04"
Second step - Keep on the PowerShell terminal and use the next command to open your WSL distro as root. The command is:
wsl -d MY_DISTRO --user root
Comentários
Postar um comentário
Parafraseando do ditado "quem conta um conto aumenta um ponto", aqui "quem comenta um post, aumenta um ponto"!