perl:警告:恢复到标准语言环境(“C”)

perl:警告:恢复到标准语言环境(“C”)

我从 perl 收到以下错误:

perl: warning: Falling back to the standard locale ("C").
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

执行此操作后的echo $PATH输出为: /home/michaelcw02/bin:/home/michaelcw02/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

我无法做到这一点,locale因为我没有安装它。

这是运行后的完整输出sudo apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libgcrypt11 libgnutls26 libslp1 libtasn1-3
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libgcrypt11 libgnutls26 libtasn1-3
Suggested packages:
  rng-tools gnutls-bin
The following packages will be REMOVED:
  bluez-cups elementary-minimal hplip language-pack-bg language-pack-bg-base language-pack-cs
  language-pack-cs-base language-pack-da language-pack-da-base language-pack-en language-pack-en-base 
  language-pack-gnome-bg language-pack-gnome-bg-base language-pack-gnome-cs language-pack-gnome-cs-base
  language-pack-gnome-da language-pack-gnome-da-base language-pack-gnome-en language-pack-gnome-en-base
  language-pack-gnome-hu language-pack-gnome-hu-base language-pack-gnome-id language-pack-gnome-id-base
  language-pack-gnome-ja language-pack-gnome-ja-base language-pack-gnome-ko language-pack-gnome-ko-base
  language-pack-gnome-nb language-pack-gnome-nb-base language-pack-gnome-nl language-pack-gnome-nl-base
  language-pack-gnome-pl language-pack-gnome-pl-base language-pack-gnome-sv language-pack-gnome-sv-base
  language-pack-gnome-th language-pack-gnome-th-base language-pack-gnome-tr language-pack-gnome-tr-base
  language-pack-gnome-uk language-pack-gnome-uk-base language-pack-gnome-vi language-pack-gnome-vi-base
  language-pack-hu language-pack-hu-base language-pack-id language-pack-id-base language-pack-ja
  language-pack-ja-base language-pack-ko language-pack-ko-base language-pack-nb language-pack-nb-base
  language-pack-nl language-pack-nl-base language-pack-pl language-pack-pl-base language-pack-sv
  language-pack-sv-base language-pack-th language-pack-th-base language-pack-tr language-pack-tr-base
  language-pack-uk language-pack-uk-base language-pack-vi language-pack-vi-base language-pack-zh-hant
  language-pack-zh-hant-base printer-driver-hpcups printer-driver-postscript-hp printer-driver-splix
  ubuntu-minimal
The following NEW packages will be installed:
  libgcrypt11 libgnutls26 libtasn1-3
0 upgraded, 3 newly installed, 73 to remove and 0 not upgraded.
Need to get 0 B/786 kB of archives.
After this operation, 258 MB disk space will be freed.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en",
    LC_ALL = (unset),
    LC_TIME = "es_CR.UTF-8",
    LC_MONETARY = "es_CR.UTF-8",
    LC_ADDRESS = "es_CR.UTF-8",
    LC_TELEPHONE = "es_CR.UTF-8",
    LC_NAME = "es_CR.UTF-8",
    LC_MEASUREMENT = "es_CR.UTF-8",
    LC_IDENTIFICATION = "es_CR.UTF-8",
    LC_NUMERIC = "es_CR.UTF-8",
    LC_PAPER = "es_CR.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

答案1

/usr/bin/locale 和 /sbin/ldconfig 均位于 libc-bin 软件包中。安装该软件包可修复您的错误。

相关内容