2

I'm working under Raspbian (for RaspberryPi):

Linux version 3.18.14-v7+ (root@vagrant-ubuntu-trusty-32) (gcc version 4.8.3 20140106 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11) )

nb : I'm connecting to the pi from my laptop using a ssh session.

When trying to solve this problem here: How to fix perl : warning : setting local failed

I run

sudo dpkg-reconfigure locales

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.UTF-8",
        LC_ALL = "en_US.UTF-8",
        LC_PAPER = "fr_FR.UTF-8",
        LC_ADDRESS = "fr_FR.UTF-8",
        LC_MONETARY = "fr_FR.UTF-8",
        LC_NUMERIC = "fr_FR.UTF-8",
        LC_TELEPHONE = "fr_FR.UTF-8",
        LC_IDENTIFICATION = "fr_FR.UTF-8",
        LC_MEASUREMENT = "fr_FR.UTF-8",
        LC_TIME = "fr_FR.UTF-8",
        LC_NAME = "fr_FR.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_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
dpkg-query: package 'locales' is not installed and no information 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: locales is not installed

locales is not installed so I run this command to install locales

sudo apt-get install locales

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 apache2-mpm-prefork : Depends: apache2.2-bin (= 2.2.22-13+deb7u5) but it is not going to be installed
 apache2.2-common : Depends: apache2.2-bin (= 2.2.22-13+deb7u5) but it is not going to be installed
                    Depends: apache2-utils but it is not going to be installed
                    Depends: procps but it is not going to be installed
                    Depends: perl but it is not going to be installed
                    Recommends: ssl-cert but it is not going to be installed
 libbz2-1.0 : PreDepends: multiarch-support but it is not going to be installed
 libc6 : Breaks: locales (< 2.19)
 libcomerr2 : PreDepends: multiarch-support but it is not going to be installed
 libdb5.1 : PreDepends: multiarch-support but it is not going to be installed
 libgcc1 : PreDepends: multiarch-support but it is not going to be installed
 libgssapi-krb5-2 : Depends: libkeyutils1 (>= 1.4) but it is not going to be installed
                    Depends: libkrb5support0 (>= 1.12~alpha1+dfsg) but it is not going to be installed
                    PreDepends: multiarch-support but it is not going to be installed
 libk5crypto3 : Depends: libkeyutils1 (>= 1.4) but it is not going to be installed
                Depends: libkrb5support0 (>= 1.12~alpha1+dfsg) but it is not going to be installed
                PreDepends: multiarch-support but it is not going to be installed
 libkrb5-3 : Depends: libkeyutils1 (>= 1.5.9) but it is not going to be installed
             Depends: libkrb5support0 (= 1.12.1+dfsg-19) but it is not going to be installed
             PreDepends: multiarch-support but it is not going to be installed
 libmagic1 : PreDepends: multiarch-support but it is not going to be installed
 libpcre3 : PreDepends: multiarch-support but it is not going to be installed
 libssl1.0.0 : Depends: debconf (>= 0.5) but it is not going to be installed or
                        debconf-2.0
               PreDepends: multiarch-support but it is not going to be installed
 libxml2 : Depends: liblzma5 (>= 5.1.1alpha+20120614) but it is not going to be installed
           PreDepends: multiarch-support but it is not going to be installed
           Recommends: xml-core but it is not going to be installed
 locales : Depends: glibc-2.13-1
           Depends: debconf (>= 0.5) but it is not going to be installed or
                    debconf-2.0
 php5-common : Depends: sed (>= 4.1.1-1) but it is not going to be installed
               Depends: psmisc (>= 22.15-1~) but it is not going to be installed
               Depends: lsof but it is not going to be installed
               PreDepends: dpkg (>= 1.16.1~) but it is not going to be installed
 tzdata : Depends: debconf (>= 0.5) but it is not going to be installed or
                   debconf-2.0
 ucf : Depends: debconf (>= 1.5.19) but it is not going to be installed
       Depends: coreutils (>= 5.91) but it is not going to be installed
 zlib1g : PreDepends: multiarch-support but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Any hints?

  • You seem to have inconsistent sources, or you're using unstable and it's broken at the moment (if you don't like broken package sources, don't use unstable). Post the content of /etc/apt/sources.list and any file in /etc/apt/sources.list.d. Also make sure you've ran apt-get update recently (and in particular after any change of the source list files). – Gilles 'SO- stop being evil' Aug 16 '15 at 19:15
  • @Gilles please see my answer below +, the file .d is empty – The Beast Aug 16 '15 at 21:54
4

This is the complete solution for my problem

  1. install locales
sudo vim /etc/apt/sources.list

-

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://apt.adafruit.com/raspbian/ wheezy main

change wheezy to jessie

run

sudo apt-get update && sudo apt-get install locales

revert back to wheezy (change jessie to wheezy )

sudo apt-get update

sudo dpkg-reconfigure locales

Now if i run

perl

i get the following warnings

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_PAPER = "fr_FR.UTF-8",
        LC_ADDRESS = "fr_FR.UTF-8",
        LC_MONETARY = "fr_FR.UTF-8",
        LC_NUMERIC = "fr_FR.UTF-8",
        LC_TELEPHONE = "fr_FR.UTF-8",
        LC_IDENTIFICATION = "fr_FR.UTF-8",
        LC_MEASUREMENT = "fr_FR.UTF-8",
        LC_TIME = "fr_FR.UTF-8",
        LC_NAME = "fr_FR.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
  1. Generating fr_FR.UTF-8 , and en_US.UTF-8

sudo nano /etc/locale.gen

uncomment those lines :

en_US.UTF-8
fr_FR.UTF-8

and finally running

sudo locale-gen
  • Why do you install the locales package from jessie? Install the one from wheezy, if you're running a wheezy system. – Gilles 'SO- stop being evil' Aug 16 '15 at 22:22
  • @Gilles when i try it with wheezy it tell me that the package was not found – The Beast Aug 16 '15 at 23:14
0

This is pretty strange default of openssh, that it sends your locale information to the servers you are connecting to. If you have some non-standard (non-US) locale, it causes more trouble than utility.

You can get rid of this by removing SendEnv LANG LC_* line from /etc/ssh/ssh_config on your laptop. This will not trigger the warnings anymore for future ssh sessions, because it will use pi's default locale.

  • plz see my answer above , i was able to install locales now but i still get some warnings , i tried to remove SendEnv LANG LC_* i rebooted but didn't solve my problem – The Beast Aug 16 '15 at 22:00
  • @Frankenstein: Don't refer to answers "above" or "below" from comments on answers or from other answers — different people see the answers in different orders at different times.  (Comments don't change order within a post (i.e., question or answer), so it's OK to to refer to "xxx's comment, above".  Also, you can refer to "xxx's answer, below" in a comment on the question (or in an edit to the question itself).) – G-Man Says 'Reinstate Monica' Aug 17 '15 at 1:23
  • @Frankenstein, are you sure you did this on YOUR machine, not on pi? – Jakuje Aug 17 '15 at 7:46
  • @Jakuje no i did this on the raspberry pi – The Beast Aug 17 '15 at 8:34
  • so you should do this on your machine – Jakuje Aug 17 '15 at 9:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.