安装systemd脚本,安装后会导致系统崩溃进不去:
安装 systemd 脚本[可选]
目前 WSL 不支持 systemd(Linux 服务管理系统),可以安装 ubuntu-wsl2-systemd-script 脚本来使用相关命令。注:安装该脚本需要将 WSL 版本切换为 WSL2 ,否则使用时可能会报错。
# 安装git
sudo apt install git
# 运行脚本和命令
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
# 重新启动 WSL 并尝试运行 systemctl
systemctl
如果显示很多内容,就是安装成功
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/w47_csdn/article/details/129107705
在Ubuntu22.04系统下,会出现错误无法通过 wsl进入系统,此时需要:
通过下面命令进入系统:
wsl -e bash --norc