Open ghost opened 2 years ago
+1 我也是这情况
Same here
+1
same here
Assuming you didn't install this on root you can start wsl as root using:
wsl --user root
Because this installs on the bash init script you should be able to log in (at least I could)
From root I was able to run the uninstall script from this fork: https://github.com/FiestaLake/ubuntu-wsl2-systemd-script/blob/master/uninstall.sh
(Or a slightly modified version to run as the root user)
self_dir=$(pwd)
rm -rf /usr/sbin/start-systemd-namespace
rm -rf /usr/sbin/enter-systemd-namespace
rm -rf /etc/sudoers.d/systemd-namespace
cd /var/tmp
if [ -f "/etc/bash.bashrc" ]; then
sudo grep -v "# Start or enter a PID namespace in WSL2
export USE_WSLG_SOCKET=false
export USE_WSLG_SOCKET=true
source /usr/sbin/start-systemd-namespace" /etc/bash.bashrc > tmpfile
sudo mv tmpfile /etc/bash.bashrc
fi
cd $self_dir
Hope this helps restore your envirnoment.