修改时区失败,求大神帮助

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
saltyfish
帖子: 2
注册时间: 2016-04-08 14:15
系统: windows

修改时区失败,求大神帮助

#1

帖子 saltyfish » 2016-04-08 14:28

lab@ubuntu:~$ date
Fri Apr 8 01:24:38 CDT 2016 ##这是当前时间
lab@ubuntu:~$ ls /etc/localtime -l
lrwxrwxrwx 1 root root 35 Apr 8 01:24 /etc/localtime -> /usr/share/zoneinfo/America/Chicago ##当前时区Chicago
lab@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ##修改时区为Shanghai
[sudo] password for lab:
lab@ubuntu:~$ ls /etc/localtime -l
lrwxrwxrwx 1 root root 35 Apr 8 14:24 /etc/localtime -> /usr/share/zoneinfo/America/Chicago ##时区未改变
lab@ubuntu:~$ date
Fri Apr 8 14:25:59 CST 2016 ##时间改变了
附件有图,时间改过来了,但是/etc/localtime没有改过来,桌面的右上角的时间及时区也没有改过来。请问为什么
附件
操作截图
操作截图
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 修改时区失败,求大神帮助

#2

帖子 vickycq » 2016-04-08 14:43

saltyfish 写了: lab@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ##修改时区为Shanghai
[请问为什么
/etc/localtime 必须是符号链接,所以不能用 cp,需要用 ln -sf
Because the timezone identifier is extracted from the symlink target name of /etc/localtime, this file may not be a normal file or hardlink.
参考 https://www.freedesktop.org/software/sy ... ltime.html
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
saltyfish
帖子: 2
注册时间: 2016-04-08 14:15
系统: windows

Re: 修改时区失败,求大神帮助

#3

帖子 saltyfish » 2016-04-11 8:36

vickycq 写了:
saltyfish 写了: lab@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ##修改时区为Shanghai
[请问为什么
/etc/localtime 必须是符号链接,所以不能用 cp,需要用 ln -sf
Because the timezone identifier is extracted from the symlink target name of /etc/localtime, this file may not be a normal file or hardlink.
参考 https://www.freedesktop.org/software/sy ... ltime.html

感谢!链接改过来了,但是桌面右上角的时间没有改变。
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 修改时区失败,求大神帮助

#4

帖子 vickycq » 2016-04-12 20:48

saltyfish 写了:链接改过来了,但是桌面右上角的时间没有改变。
执行 date 看看时间是否正确
若系统为 15.10,执行 timedatectl 将输出全部复制贴上来
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
回复