R语言 未能创建总线连接;运行命令“timedatectl”的状态为% 1

uttx8gqw  于 2023-10-13  发布在  其他
关注(0)|答案(2)|浏览(153)

我用的是WSL 2。在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.
8yparm6h

8yparm6h1#

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

export TZ="America/New_York"

然后重新加载bash,它应该可以识别时区。你可以在这里看到更多关于时区名称的信息:https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

kxxlusnw

kxxlusnw2#

假设Debian系统

sudo apt-get install libxml2-dev

将TZ修改为您的timeozne

TZ=“Europe/柏林”R -e 'install.packages(“tidyverse”)'

相关问题