【发布时间】:2022-07-09 04:25:15
【问题描述】:
我正在使用 WSL2。 在 R 中,我尝试安装软件包。例如:
> install.packages("tidyverse")
但我收到了 Failed to create bus connection 错误。
追溯:
Failed to create bus connection: No such file or directory
Warning in system("timedatectl", intern = TRUE) :
running command 'timedatectl' had status 1
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Failed to create bus connection: No such file or directory
Warning in system("timedatectl", intern = TRUE) :
running command 'timedatectl' had status 1
** testing if installed package can be loaded from final location
Failed to create bus connection: No such file or directory
Warning in system("timedatectl", intern = TRUE) :
running command 'timedatectl' had status 1
** testing if installed package keeps a record of temporary installation path
* DONE (tidyverse)
The downloaded source packages are in
‘/tmp/RtmpD1g9KP/downloaded_packages’
我已尝试安装 dbus 包:
sudo apt-get update
sudo apt-get install dbus
重启后仍然出现错误。
我也试过了:
sudo systemctl status
但它会返回:
System has not been booted with systemd as init system (PID 1). Can't operate.
【问题讨论】:
-
看来
systemd未安装或未启用。官方 WSL1 或 WSL2 尚不支持它。这可以通过运行sudo systemctl status来确认。您是否安装了systemd-genie,这是在 WSL2 上支持systemd的解决方法? -
@fpmurphy
sudo systemctl status返回System has not been booted with systemd as init system (PID 1). Can't operate.
标签: r linux ubuntu windows-subsystem-for-linux