• Uncategorized

About r : Failed-to-create-bus-connection-running-command-timedatectl-had-status-1

Question Detail

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.

Question Answer

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

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.