topic title: smxi LC_ LANG_
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#1
Ever since I have started using the smxi script and installing new kernels I have had to keep resetting the locales every time I boot into a different kernel. Is this normal? I don't remember ever having to reset this on an upgrade like this before. Is there some way that this setting can span kernel options by being global and permanent?
Posts: 73
h2
Joined: 13 Jun 2008
#2
Make sure your locales are configured, I've never seen this issue, so I have to suspect it's something in antix or mepis.

dpkg-reconfigure locales

other than that I cant' say, you'll find over time the idea of diverging too far from debian standard practices makes interactions with standard debian tools problematic, hopefully mepis will pull itself back closer to debian after its adventures in ubuntu land, __{{emoticon}}__
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#3
I tried to configure the locales and they are fine. I keep getting messages in the terminal about LC and LANG not being set. I have done LC=........... and LANG=..... and export........... but the messages will eventually come back. I will have to watch further.
Posts: 73
h2
Joined: 13 Jun 2008
#4
You may be missing the core /etc/profile setting of languages:

Code: Select all

cat /etc/profile
# /etc/profile
umask 022
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games"
["$UID" ="0" ] || PATH="$HOME/.dist/bin:$PATH:."
export PATH
# Change PAGER
if [ -x /usr/bin/most ]; then
    PAGER=/usr/bin/most
    export PAGER
fi
# Set LOCALE
if [ -f /etc/sysconfig/i18n ]; then
    . /etc/sysconfig/i18n
    [ -n"$LANG" ] || LANG="de_DE@euro"
    export LANG
    [ -n"$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
    [ -n"$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
    [ -n"$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
    [ -n"$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
    [ -n"$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
    [ -n"$LC_TIME" ] && export LC_TIME || unset LC_TIME
    [ -n"$LC_ALL" ] && export LC_ALL || unset LC_ALL
    [ -n"$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
    [ -n"$LINGUAS" ] && export LINGUAS || unset LINGUAS
    [ -n"$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET

    if [ -n"$SYSFONTACM" ]; then
        case $SYSFONTACM in
            iso01*|iso02*|iso15*|koi*|latin2-ucw*)
                if ["$TERM" ="linux" ]; then
                    if ls -l /proc/$$/fd/0 2>/dev/null | grep -- '-> /dev/tty[0-9]*$' >/dev/null 2>&1; then
                        echo -n -e '\033(K' > /proc/$$/fd/0
                    fi
                fi
                ;;
        esac
    fi
    unset SYSFONTACM
fi
# END LOCALE
# enable bash completion in interactive shells
["$PS1" -a -f /etc/bash_completion ] && . /etc/bash_completion
PS1="\u@\h:\w\\$"
alias ..="cd .."
alias which="type -path"
alias where="type -all"
alias ll="ls -l --color=auto"
alias l="ls -a --color=auto"
alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"
alias la="ls -la --color=auto"
alias ls="ls --color=auto"
Posts: 73
h2
Joined: 13 Jun 2008
#5
this file should be loaded in both ~/.bashrc and /root/.bashrc

Code: Select all

cat .bashrc
# /etc/bash.bashrc
[ -f /etc/profile ] && . /etc/profile
... and so on....
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#6
This is what I get when I try to set the locale:

Code: Select all

root@compaq:/home/eriefisher# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE ="en_US.utf8",
    LC_ALL ="en_US",
    LC_CTYPE ="en_US",
    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
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE ="en_US.utf8",
    LC_ALL ="en_US",
    LC_CTYPE ="en_US",
    LANG ="en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE ="en_US.utf8",
    LC_ALL ="en_US",
    LC_CTYPE ="en_US",
    LANG ="en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
root@compaq:/home/eriefisher# 
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#7
Ok, I think I got it. I installed locales-all and did a dpkg-reconfigure locales and it seem to set it up this time. We will have to see how it goes.
Posts: 73
h2
Joined: 13 Jun 2008
#8
Just so you know, i don't have that package installed on my systems, and it's fine.

Check your bashrc and profile stuff. I think you haven't found the actual source of the problem, although you may have found a work around.
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#9
Well there is no /root/.bashrc so I created one(now blank) and this is my ~/.bashrc

Code: Select all

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z"$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval"$(lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z"$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we"want" color)
case"$TERM" in
xterm-color)
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    ;;
*)
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    ;;
esac

# Comment in the above and uncomment this below for a color prompt
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

# If this is an xterm set the title to user@host:dir
case"$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne"\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
#    . ~/.bash_aliases
#fi

# enable color support of ls and also add handy aliases
if ["$TERM" !="dumb" ]; then
    eval"`dircolors -b`"
    alias ls='ls --color=auto'
    #alias dir='ls --color=auto --format=vertical'
    #alias vdir='ls --color=auto --format=long'
fi

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

export LC_ALL=en_US
export LANG=en_US.utf8
export LC_CTYPE=en_US
And this is my /etc/profile:

Code: Select all

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if ["`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi

if ["$PS1" ]; then
  if ["$BASH" ]; then
    PS1='\u@\h:\w\$ '
  else
    if ["`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

export PATH

umask 022