Fix "warning: Setting locale failed." di Ubuntu

Jum, 05/09/2014 - 16:43 -- bonny

Setelah install Ubuntu Server 14.04 saat melakukan update dan upgrade dengan perintah:

sudo apt-get update && upgrade -y

Saya mendapat pesan error "warning: Setting locale failed." seperti pesan dibawah ini:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_TIME = "id_ID.UTF-8",
LC_MONETARY = "id_ID.UTF-8",
LC_ADDRESS = "id_ID.UTF-8",
LC_TELEPHONE = "id_ID.UTF-8",
LC_NAME = "id_ID.UTF-8",
LC_MEASUREMENT = "id_ID.UTF-8",
LC_IDENTIFICATION = "id_ID.UTF-8",
LC_NUMERIC = "id_ID.UTF-8",
LC_PAPER = "id_ID.UTF-8",
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_ALL to default locale: No such file or directory

Cara memperbaikinya error pada locale

Hal yang pertama kita lakukan adalah periksa locale dengan:

bonny@grobak:~$ locale

Kemudian akan tampil:

locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=id_ID.UTF-8
LC_TIME=id_ID.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=id_ID.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=id_ID.UTF-8
LC_NAME=id_ID.UTF-8
LC_ADDRESS=id_ID.UTF-8
LC_TELEPHONE=id_ID.UTF-8
LC_MEASUREMENT=id_ID.UTF-8
LC_IDENTIFICATION=id_ID.UTF-8
LC_ALL=

Kemudian jalankan perintah untuk membuat dan mengkonfigurasi ulang locale yang hilang tersebut dengan,

bonny@grobak:~$ sudo locale-gen id_ID.UTF-8
Generating locales...
id_ID.UTF-8... done
Generation complete.
bonny@grobak:~$ sudo dpkg-reconfigure locales
Generating locales...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
id_ID.UTF-8... up-to-date
Generation complete.

 

Kemudian periksa ulang kembali locale, maka pesan "missing locale" tadi sudah hilang.