ubuntu怎样修改时区并修改系统时间

安装tzdata设置时区,时间也会自动同步了

root@v2ray-tw:~# apt-get install tzdata
 Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
 The following NEW packages will be installed:
   tzdata
 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
 Need to get 187 kB of archives.
 After this operation, 3098 kB of additional disk space will be used.
 Get:1 http://asia-east1.gce.archive.ubuntu.com/ubuntu disco-updates/main amd64 tzdata all 2019b-0ubuntu0.19.04 [187 kB]
 Fetched 187 kB in 1s (220 kB/s)
 debconf: delaying package configuration, since apt-utils is not installed
 Selecting previously unselected package tzdata.
 (Reading database … 47864 files and directories currently installed.)
 Preparing to unpack …/tzdata_2019b-0ubuntu0.19.04_all.deb …
 Unpacking tzdata (2019b-0ubuntu0.19.04) …
 Setting up tzdata (2019b-0ubuntu0.19.04) …
 debconf: unable to initialize frontend: Dialog
 debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
 debconf: falling back to frontend: Readline
 Configuring tzdata
 Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by
 presenting a list of cities, representing the time zones in which they are located.
 Africa   3. Antarctica  5. Arctic  7. Atlantic  9. Indian    11. SystemV  13. Etc
 America  4. Australia   6. Asia    8. Europe    10. Pacific  12. US
 Geographic area: 6 
 Please select the city or region corresponding to your time zone.
 Aden      14. Beirut      27. Gaza         40. Karachi       53. Muscat        66. Riyadh         79. Tokyo
 Almaty    15. Bishkek     28. Harbin       41. Kashgar       54. Nicosia       67. Sakhalin       80. Tomsk
 Amman     16. Brunei      29. Hebron       42. Kathmandu     55. Novokuznetsk  68. Samarkand      81. Ujung_Pandang
 Anadyr    17. Chita       30. Ho_Chi_Minh  43. Khandyga      56. Novosibirsk   69. Seoul          82. Ulaanbaatar
 Aqtau     18. Choibalsan  31. Hong_Kong    44. Kolkata       57. Omsk          70. Shanghai       83. Urumqi
 Aqtobe    19. Chongqing   32. Hovd         45. Krasnoyarsk   58. Oral          71. Singapore      84. Ust-Nera
 Ashgabat  20. Colombo     33. Irkutsk      46. Kuala_Lumpur  59. Phnom_Penh    72. Srednekolymsk  85. Vientiane
 Atyrau    21. Damascus    34. Istanbul     47. Kuching       60. Pontianak     73. Taipei         86. Vladivostok
 Baghdad   22. Dhaka       35. Jakarta      48. Kuwait        61. Pyongyang     74. Tashkent       87. Yakutsk
 Bahrain  23. Dili        36. Jayapura     49. Macau         62. Qatar         75. Tbilisi        88. Yangon
 Baku     24. Dubai       37. Jerusalem    50. Magadan       63. Qostanay      76. Tehran         89. Yekaterinburg
 Bangkok  25. Dushanbe    38. Kabul        51. Makassar      64. Qyzylorda     77. Tel_Aviv       90. Yerevan
 Barnaul  26. Famagusta   39. Kamchatka    52. Manila        65. Rangoon       78. Thimphu
 Time zone: 70 
 Current default time zone: 'Asia/Shanghai'
 Local time is now:      Thu Aug  1 08:53:21 CST 2019.
 Universal Time is now:  Thu Aug  1 00:53:21 UTC 2019.
 Run 'dpkg-reconfigure tzdata' if you wish to change it.
 root@v2ray-tw:~# 
 root@v2ray-tw:~# date
 Thu Aug  1 08:53:24 CST 2019
root@v2ray-tw:~# date -R
 Thu, 01 Aug 2019 08:56:19 +0800

可以看到时间已同步

发表评论

后才能评论