简体   繁体   中英

Failed to create bus connection; running command 'timedatectl' had status 1

I'm using WSL2. In R, I tried to install packages. For example:

> install.packages("tidyverse")

But I'm getting a Failed to create bus connection error.

Traceback:

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’

I've tried to install the dbus package:

sudo apt-get update
sudo apt-get install dbus

And am still getting the error after reboot.

I also tried:

sudo systemctl status

but it returns:

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

In .bashrc, or in some other alias file, add a variable for TZ. For me, I did

export TZ="America/New_York"

Then reload bash and it should recognize the timezone. You can see more about the timezone names here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM