12

The scenario: I'm trying to set timezone on a docker container based on Ubuntu 18.04 docker image. Just pull the image and updated

> apt-get -y update

The error:

When run

> timedatectl

I get

> timedatectl: command not found

The question: How to install timedatectl?

What I've tried so far: I tried to install timedatectl as follows

> apt-get -y install timedatectl
> Unable to locate package timedatectl

Thank you

GabrieleMartini
  • 603
  • 2
  • 10
  • 27

1 Answers1

10

As suggested in the comment, installed systemd package:

> apt-get install systemd

timedatectl is installed

GabrieleMartini
  • 603
  • 2
  • 10
  • 27
  • 5
    I got error after installing systemd and run timedatectl > System has not been booted with systemd as init system (PID 1). Can't operate. – Nam G VU Feb 10 '23 at 06:02