无法将代码服务器安装到 WSL 上。 "System has not been booted with systemd as init system (PID 1). Can't operate."

Cannot install code-server onto WSL. "System has not been booted with systemd as init system (PID 1). Can't operate."

我正在按照此处的说明下载代码服务器:https://github.com/cdr/code-server/blob/v3.8.0/doc/install.md#debian-ubuntu

因为我在 windows,所以我在 Windows 子系统上使用 Ubuntu Linux (WSL)。

我已经成功运行以下两行:

curl -fOL https://github.com/cdr/code-server/releases/download/v3.8.0/code-server_3.8.0_amd64.deb
sudo dpkg -i code-server_3.8.0_amd64.deb

但是,我对最后一行有疑问:

sudo systemctl enable --now code-server@$USER

我收到以下错误:

System has not been booted with systemd as init system (PID 1). Can't operate.

任何帮助将不胜感激:)

错误消息表明 .deb 被设计为使用 systemd,WSL 不支持它(没有 很多 额外的努力)。

但是,code-server 似乎支持基于“独立”(非软件包)的安装。有关详细信息,请参阅安装文档的 this section