Konfigurasi Locales & Time Zone di Ubuntu Server


Assalamualaikum wr.wb

Setelah beberapa jam mencari referensi konfigurasi locales & Time Zone pada ubuntu server akhirnya ketemu juga. ternyata cara konfigurasi locales pada debian dengan ubuntu sangatlah berbeda. jika pada debian menggunakan perintah #dpkg-reconfigure locales seperti pada Artikel saya sebelumya yang berjudul Konfigurasi Locales di Debian . maka di Ubuntu server dapat mengikuti history konfigurasi melalui ssh di terminal saya yaitu :

root@smkpwd:/var/www/html# echo "export LC_ALL=id_ID.utf8" >> /etc/profile
root@smkpwd:/var/www/html# export LC_ALL=id_ID.utf8
bash: warning: setlocale: LC_ALL: cannot change locale (id_ID.utf8)
root@smkpwd:/var/www/html# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
root@smkpwd:/var/www/html# echo "export LC_ALL=id_ID" >> /etc/profile
root@smkpwd:/var/www/html# export LC_ALL=id_ID
bash: warning: setlocale: LC_ALL: cannot change locale (id_ID)
root@smkpwd:/var/www/html# sudo dpkg-reconfigure locale
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "id_ID",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Package `locale' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
/usr/sbin/dpkg-reconfigure: locale is not installed
root@smkpwd:/var/www/html# date
Thu Mar  10 14:02:28 WIB 2016
root@smkpwd:/var/www/html# sudo apt-get install locale
Reading package lists... Done
Building dependency tree     
Reading state information... Done
E: Unable to locate package locale
root@smkpwd:/var/www/html# nano /var/lib/locales/supported.d/local
  GNU nano 2.2.4      File: /var/lib/locales/supported.d/local                

id_ID.UTF-8 UTF-8

                                [ Wrote 1 line ]

root@smkpwd:/var/www/html# sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "id_ID",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (id_ID)
Generating locales...
  en_AG.UTF-8... up-to-date
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NG.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
  id_ID.UTF-8... done
Generation complete.
root@smkpwd:/var/www/html# date
Thu Mar  10 14:04:48 WIB 2016
root@smkpwd:/var/www/html# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
id_ID.utf8
root@smkpwd:/var/www/html# LC_TIME="id_ID.UTF-8" date
Thu Mar  10 14:08:21 WIB 2016
root@smkpwd:/var/www/html# LC_TIME="id_ID.utf8" date
Thu Mar  10 14:08:55 WIB 2016
root@smkpwd:/var/www/html# sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "id_ID",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (id_ID)
Generating locales...
  en_AG.UTF-8... up-to-date
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NG.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
  id_ID.UTF-8... up-to-date
Generation complete.
root@smkpwd:/var/www/html# nano /etc/environment
  GNU nano 2.2.4            File: /etc/environment                            

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

root@smkpwd:/var/www/html# nano /etc/default/locale
  GNU nano 2.2.4           File: /etc/default/locale                          

LANG="id_ID"      
LANGUANGE="id_ID:id"
                               [ Wrote 2 lines ]


root@smkpwd:/var/www/html# LC_TIME="id_ID.utf8" date
Thu Mar  10 14:20:23 WIB 2016
root@smkpwd:/var/www/html# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
id_ID.utf8
root@smkpwd:/var/www/html# nano /etc/default/locale
  GNU nano 2.2.4           File: /etc/default/locale                          

LANG="id_ID.UTF-8"
LANGUANGE="id_ID:id"
                               [ Wrote 2 lines ]


root@smkpwd:/var/www/html# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "id_ID",
        LANG = "id_ID.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (id_ID)
Generating locales...
  en_AG.UTF-8... up-to-date
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NG.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
  id_ID.UTF-8... up-to-date
Generation complete.
root@smkpwd:/var/www/html# tzselect
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (id_ID)
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
 1) Africa
 2) Americas
 3) Antarctica
 4) Arctic Ocean
 5) Asia
 6) Atlantic Ocean
 7) Australia
 8) Europe
 9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 5
Please select a country.
 1) Afghanistan           18) Israel                35) Palestine
 2) Armenia               19) Japan                 36) Philippines
 3) Azerbaijan            20) Jordan                37) Qatar
 4) Bahrain               21) Kazakhstan            38) Russia
 5) Bangladesh            22) Korea (North)         39) Saudi Arabia
 6) Bhutan                23) Korea (South)         40) Singapore
 7) Brunei                24) Kuwait                41) Sri Lanka
 8) Cambodia              25) Kyrgyzstan            42) Syria
 9) China                 26) Laos                  43) Taiwan
10) Cyprus                27) Lebanon               44) Tajikistan
11) East Timor            28) Macau                 45) Thailand
12) Georgia               29) Malaysia              46) Turkmenistan
13) Hong Kong             30) Mongolia              47) United Arab Emirates
14) India                 31) Myanmar (Burma)       48) Uzbekistan
15) Indonesia             32) Nepal                 49) Vietnam
16) Iran                  33) Oman                  50) Yemen
17) Iraq                  34) Pakistan
#? 15
Please select one of the following time zone regions.
1) Java & Sumatra
2) west & central Borneo
3) east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
4) Irian Jaya & the Moluccas
#? 1

The following information has been given:

        Indonesia
        Java & Sumatra

Therefore TZ='Asia/Jakarta' will be used.
Local time is now:      Thu Mar  9 14:24:00 WIB 2016.
Universal Time is now:  Thu Mar  9 07:05:22 UTC 2016.
Is the above information OK?
1) Yes
2) No
#? 1

You can make this change permanent for yourself by appending the line
        TZ='Asia/Jakarta'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Jakarta

root@smkpwd:/var/www/html# locale-gen id_ID
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (id_ID)
Generating locales...
  id_ID.ISO-8859-1... done
Generation complete.
root@smkpwd:/var/www/html# locale -a
C
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
id_ID
id_ID.iso88591
id_ID.utf8
POSIX
root@smkpwd:/var/www/html# LC_TIME="id_ID.UTF-8" date
Kam Mar  10 14:25:28 WIB 2016
root@smkpwd:/var/www/html# locale-gen id_ID
Generating locales...
  id_ID.ISO-8859-1... up-to-date
Generation complete.
root@smkpwd:/var/www/html# date
Kam Mar  10 14:26:20 WIB 2016 


Sekian Sedikit Ilmu yang dapat saya share.
Sumber Ilmu di atas http://catatan-kuliahku.blogspot.co.id/2011/06/merubah-waktu-server-ubuntu-ke.html
Selamat Mencoba :D
Wassalamualaikum wr.wb

0 Response to "Konfigurasi Locales & Time Zone di Ubuntu Server "

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel