2020/03/29

Ubuntu 19.10 LTS Mini. install 調整Linux內部預設時區

Ubuntu 19.10  LTS Mini. install 調整Linux內部預設時區

tzdata


最小安裝 ubuntu 的時候,預設都是設定 UTC +0 的時區,有時候真的很難對時間。

Ubuntu 只要透過安裝 tzdata 就可以設定預設時間了 sudo apt-get install tzdata

如果你已經設定過了,可以透過 sudo dpkg-reconfigure tzdata 重新設定。

詳細過程如下:

jangmt@instance-1-tokyo:/usr/share$ sudo 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 0 not upgraded.
Need to get 208 kB of archives.
After this operation, 3534 kB of additional disk space will be used.
Get:1 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu eoan/main amd64 tzdata all 2019c-3 [208 kB]
Fetched 208 kB in 1s (171 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package tzdata.
(Reading database ... 63700 files and directories currently installed.)
Preparing to unpack .../tzdata_2019c-3_all.deb ...
Unpacking tzdata (2019c-3) ...
Setting up tzdata (2019c-3) ...
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.
  1. Africa   3. Antarctica  5. Arctic  7. Atlantic  9. Indian    11. SystemV  13. Etc
  2. 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.
  1. Aden      16. Brunei       31. Hong_Kong    46. Kuala_Lumpur  61. Pyongyang      76. Tehran
  2. Almaty    17. Chita        32. Hovd         47. Kuching       62. Qatar          77. Tel_Aviv
  3. Amman     18. Choibalsan   33. Irkutsk      48. Kuwait        63. Qostanay       78. Thimphu
  4. Anadyr    19. Chongqing    34. Istanbul     49. Macau         64. Qyzylorda      79. Tokyo
  5. Aqtau     20. Colombo      35. Jakarta      50. Magadan       65. Rangoon        80. Tomsk
  6. Aqtobe    21. Damascus     36. Jayapura     51. Makassar      66. Riyadh         81. Ujung_Pandang
  7. Ashgabat  22. Dhaka        37. Jerusalem    52. Manila        67. Sakhalin       82. Ulaanbaatar
  8. Atyrau    23. Dili         38. Kabul        53. Muscat        68. Samarkand      83. Urumqi
  9. Baghdad   24. Dubai        39. Kamchatka    54. Nicosia       69. Seoul          84. Ust-Nera
  10. Bahrain  25. Dushanbe     40. Karachi      55. Novokuznetsk  70. Shanghai       85. Vientiane
  11. Baku     26. Famagusta    41. Kashgar      56. Novosibirsk   71. Singapore      86. Vladivostok
  12. Bangkok  27. Gaza         42. Kathmandu    57. Omsk          72. Srednekolymsk  87. Yakutsk
  13. Barnaul  28. Harbin       43. Khandyga     58. Oral          73. Taipei         88. Yangon
  14. Beirut   29. Hebron       44. Kolkata      59. Phnom_Penh    74. Tashkent       89. Yekaterinburg
  15. Bishkek  30. Ho_Chi_Minh  45. Krasnoyarsk  60. Pontianak     75. Tbilisi        90. Yerevan
Time zone: 73

Current default time zone: 'Asia/Taipei'
Local time is now:      Sun Mar 29 19:17:53 CST 2020.
Universal Time is now:  Sun Mar 29 11:17:53 UTC 2020.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

jangmt@instance-1-tokyo:/usr/share$ timedatectl
               Local time: Sun 2020-03-29 19:19:27 CST
           Universal time: Sun 2020-03-29 11:19:27 UTC
                 RTC time: Sun 2020-03-29 11:19:28
                Time zone: Asia/Taipei (CST, +0800)
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no