Score:0

How to disable profile script in WSL Ubuntu 2004?

us flag

I added some lines in /etc/profile to set WSL IP address to a fixed one, and it worked perfectly. However, the next day WSL cannot start, even wsl --help stucks forever. I highly suspect the /etc/profile is the problem, so is there a way to start WSL without running the profile script?

Score:2
hr flag

You can use WSL's -exec or -e to execute a command in place of the default login shell:

--exec, -e <CommandLine>
    Execute the specified command without using the default Linux shell.

So either start a different shell

wsl -e /bin/dash

or execute the default /bin/bash with the --noprofile option, to skip loading of default profile files, including the system-wide /etc/profile:

wsl -e /bin/bash --noprofile
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.