【问题标题】:Failed to create bus connection; running command 'timedatectl' had status 1创建总线连接失败;运行命令“timedatectl”的状态为 1
【发布时间】: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


【解决方案1】:

在 .bashrc 或其他别名文件中,为 TZ 添加一个变量。对我来说,我做到了

export TZ="America/New_York"

然后重新加载 bash,它应该可以识别时区。您可以在此处查看有关时区名称的更多信息:https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

【讨论】:

    猜你喜欢
    • 2022-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-20
    • 2023-03-08
    • 2011-07-23
    • 1970-01-01
    相关资源
    最近更新 更多