34.8 C
Jakarta
Rabu, 12 Februari 2025

Perl warning Setting locale failed di Debian

Saat Instalasi Debian atau Ubuntu, locales mungkin tidak sepenuhnya diinstall. Selama instalasi Perl aplikasi (seperti nagios), peringatan, perl: warning: Setting locale failed, sering muncul.
Pesan peringatan selama instalasi aplikasi Perl akan muncul sebagai berikut:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Masalah ini muncul ketika paket sedang ditambahkan.
Contoh berikut akan menampilkan output yang sesuai :

root@server:~# apt-get install multipath-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  dmsetup kpartx libaio1
Suggested packages:
  multipath-tools-boot
The following NEW packages will be installed:
  dmsetup kpartx libaio1 multipath-tools
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 266kB of archives.
After this operation, 950kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.de.debian.org lenny/main dmsetup 2:1.02.27-4 [39.7kB]
Get:2 http://ftp.de.debian.org lenny/main kpartx 0.4.8-14+lenny2 [26.0kB]
Get:3 http://ftp.de.debian.org lenny/main libaio1 0.3.107-3 [7414B]
Get:4 http://ftp.de.debian.org lenny/main multipath-tools 0.4.8-14+lenny2 [193kB]
Fetched 266kB in 1s (154kB/s)           
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    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
Selecting previously deselected package dmsetup.
(Reading database ... 27499 files and directories currently installed.)
Unpacking dmsetup (from .../dmsetup_2%3a1.02.27-4_amd64.deb) ...
Selecting previously deselected package kpartx.
Unpacking kpartx (from .../kpartx_0.4.8-14+lenny2_amd64.deb) ...
Selecting previously deselected package libaio1.
Unpacking libaio1 (from .../libaio1_0.3.107-3_amd64.deb) ...
Selecting previously deselected package multipath-tools.
Unpacking multipath-tools (from .../multipath-tools_0.4.8-14+lenny2_amd64.deb) ...
Processing triggers for man-db ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
/usr/bin/mandb: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
Setting up dmsetup (2:1.02.27-4) ...
Setting up kpartx (0.4.8-14+lenny2) ...
Setting up libaio1 (0.3.107-3) ...
Setting up multipath-tools (0.4.8-14+lenny2) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Starting multipath daemon: multipathd.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
root@server:~#

Generate di locales

Sering terjadi kesalahan pada locales perl dapat di generated dengan  locale-gen:
locale-gen en_US.UTF-8

Alternativ locale file dapat dibuat manual dengan  localedef :
localedef -i en_US -f UTF-8 en_US.UTF-8

Setting Locale Settings

Locale settings dapat di Set (contoh: en_US.UTF-8) sebagai berikut:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

Perintah Locales dpkgreconfigure akan mengacu untuk Debian untuk memilih locale yang diinginkan.
Opsi ini tidak akan muncul di Distro Ubuntu.

Saat Instalasi Debian atau Ubuntu, locales mungkin tidak sepenuhnya diinstall. Selama instalasi Perl aplikasi (seperti nagios), peringatan, perl: warning: Setting locale failed, sering muncul.
Pesan peringatan selama instalasi aplikasi Perl akan muncul sebagai berikut:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Masalah ini muncul ketika paket sedang ditambahkan.
Contoh berikut akan menampilkan output yang sesuai :

root@server:~# apt-get install multipath-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  dmsetup kpartx libaio1
Suggested packages:
  multipath-tools-boot
The following NEW packages will be installed:
  dmsetup kpartx libaio1 multipath-tools
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 266kB of archives.
After this operation, 950kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.de.debian.org lenny/main dmsetup 2:1.02.27-4 [39.7kB]
Get:2 http://ftp.de.debian.org lenny/main kpartx 0.4.8-14+lenny2 [26.0kB]
Get:3 http://ftp.de.debian.org lenny/main libaio1 0.3.107-3 [7414B]
Get:4 http://ftp.de.debian.org lenny/main multipath-tools 0.4.8-14+lenny2 [193kB]
Fetched 266kB in 1s (154kB/s)           
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    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
Selecting previously deselected package dmsetup.
(Reading database ... 27499 files and directories currently installed.)
Unpacking dmsetup (from .../dmsetup_2%3a1.02.27-4_amd64.deb) ...
Selecting previously deselected package kpartx.
Unpacking kpartx (from .../kpartx_0.4.8-14+lenny2_amd64.deb) ...
Selecting previously deselected package libaio1.
Unpacking libaio1 (from .../libaio1_0.3.107-3_amd64.deb) ...
Selecting previously deselected package multipath-tools.
Unpacking multipath-tools (from .../multipath-tools_0.4.8-14+lenny2_amd64.deb) ...
Processing triggers for man-db ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
/usr/bin/mandb: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
manconv: can't set the locale; make sure $LC_* and $LANG are correct
Setting up dmsetup (2:1.02.27-4) ...
Setting up kpartx (0.4.8-14+lenny2) ...
Setting up libaio1 (0.3.107-3) ...
Setting up multipath-tools (0.4.8-14+lenny2) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Starting multipath daemon: multipathd.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
root@server:~#

Generate di locales

Sering terjadi kesalahan pada locales perl dapat di generated dengan  locale-gen:
locale-gen en_US.UTF-8

Alternativ locale file dapat dibuat manual dengan  localedef :
localedef -i en_US -f UTF-8 en_US.UTF-8

Setting Locale Settings

Locale settings dapat di Set (contoh: en_US.UTF-8) sebagai berikut:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

Perintah Locales dpkgreconfigure akan mengacu untuk Debian untuk memilih locale yang diinginkan.
Opsi ini tidak akan muncul di Distro Ubuntu.

Untuk mendapatkan Berita & Review menarik Saksenengku Network
Google News

Artikel Terkait

Populer

Artikel Terbaru