Symptoms
Plesk upgrade fails with the below error:
There is no /etc/localtime file in system.
Run tzsetup as root to set up your timezone
OR:
***** problem report *****
There is no /etc/localtime file in system.
Run tzsetup as root to set up your timezone
Cause
Absent or broken /etc/localtime
file or tzdata
package.
Resolution
-
Connect to the server via SSH;
Note: if direct SSH access to the server is not possible, contact server administrator for further assistance.
-
Make sure that
tzdata
package is installed.# rpm -qi tzdata #for CentOS/RedHat
OR
# dpkg -l tzdata #for Debian/UbuntuIf not, then install the package:
# apt install tzdata #for Debian/Ubuntu
# yum install tzdata #for CentOS/RedHat -
Make sure that the
/etc/localtime
file exists:# ls -la /etc/localtime
-rw-r–r– 1 root root 1180 Jul 9 2013 /etc/localtime -
If it is absent, create symlink corresponding to your timezone, as below:
# ln -s /usr/share/zoneinfo/GMT /etc/localtime
# ll /etc/localtime
lrwxrwxrwx 1 root root 23 Dec 11 21:22 /etc/localtime -> /usr/share/zoneinfo/GMT
For CentOS operating systems the following solution is applicable:
-
Find required timezone:
# timedatectl list-timezones | grep Melb
Australia/Melbourne -
Set the required timezone:
# timedatectl set-timezone `timedatectl list-timezones | grep Melb`
-
Ensure that the changes are applied:
# ls -l /etc/localtime
lrwxrwxrwx 1 root root 41 Nov 3 06:22 /etc/localtime -> ../usr/share/zoneinfo/Australia/Melbourne# date
Tue Nov 3 06:22:55 EST 2015