Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Dec 21, 2010 4:17 pm 
Offline
Senior Newbie

Joined: Wed Jun 09, 2010 12:28 pm
Posts: 12
Hello;
I have a Ubuntu 10.04.1 LTS VPS here.
And I have a little problem with environment variables.

In my environment when I try to run $ locale it gives result as

Code:
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=


because of that I cannot use utf-8 characters in terminal.

I have tried # dpkg-reconfigure locales and it gives result as

Code:
Generating locales...
  en_AG.UTF-8... up-to-date
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NG.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
Generation complete.


but still $ locale gives same..

I have researched by Google and I have find out that i dont have "/etc/default/locale" file.. I have generated that but nothing changes...

I have searched in this forum and I have found this topic.. but $ apt-get install locales-all didn't work out..

I am a newbie on linux.

Is the problem for just me?

Does anybody have a solution for this problem?
or
Can anybody show me the right direction to solve this problem?

Thanks for your time...


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 6:04 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Try
Code:
apt-get install --reinstall locales


Also try adding the following line to /etc/default/locale
Code:
LANG="en_US.UTF-8"


Also, you can set system-wide environment variables by specifying them in /etc/environment

See: https://help.ubuntu.com/community/EnvironmentVariables


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 6:26 pm 
Offline
Senior Newbie

Joined: Wed Jun 09, 2010 12:28 pm
Posts: 12
hybinet wrote:
Try
Code:
apt-get install --reinstall locales


Also try adding the following line to /etc/default/locale
Code:
LANG="en_US.UTF-8"


Also, you can set system-wide environment variables by specifying them in /etc/environment

See: https://help.ubuntu.com/community/EnvironmentVariables


thanks for reply

reinstallation
Code:
$ sudo apt-get install --reinstall locales
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 3552kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.ubuntu.com/ubuntu/ lucid/main locales 2.11+git20100304-3 [3552kB]
Fetched 3552kB in 0s (11.8MB/s)
(Reading database ... 42040 files and directories currently installed.)
Preparing to replace locales 2.11+git20100304-3 (using .../locales_2.11+git20100304-3_all.deb) ...
Unpacking replacement locales ...
Processing triggers for man-db ...
Setting up locales (2.11+git20100304-3) ...
Generating locales...
  en_AG.UTF-8... up-to-date
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NG.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
Generation complete.


after reinstallation result the same
Code:
$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=


there is no any /etc/default/locale file.. I have tried to create it and result is the same...

/etc/environment
Code:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

how should I change the environment file ?


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 6:44 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Code:
LANG="en_US.UTF-8"


Create the /etc/default/locale file, and add the line above.

In the case of /etc/environment, keep the existing line, and add another line below it.

Log out, and log back in. If you don't see any changes, try rebooting your Linode.


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 7:03 pm 
Offline
Senior Newbie

Joined: Wed Jun 09, 2010 12:28 pm
Posts: 12
I did exactly what you have said.. And threre is no changes...


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 11:25 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
That's strange, the locale setting should stick after a reboot. Did the file(s) get deleted/overwritten by something?


Top
   
 Post subject:
PostPosted: Wed Dec 22, 2010 8:56 am 
Offline
Senior Newbie

Joined: Wed Jun 09, 2010 12:28 pm
Posts: 12
hybinet wrote:
That's strange, the locale setting should stick after a reboot. Did the file(s) get deleted/overwritten by something?


I didn't see that kind of message.. I believe it is the same since the beginning..

When I installed postgresql server it installed as ASCII encoding.. I had to reconfigure it to convert it to UTF8.. And normally it installs as UTF8 encoding..

Edit:
when I try as root

Code:
$ sudo su
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


but this is not work

Code:
$ sudo -i
$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=


Top
   
 Post subject: Solution
PostPosted: Wed Dec 22, 2010 9:56 am 
Offline
Senior Newbie

Joined: Wed Jun 09, 2010 12:28 pm
Posts: 12
Solution:

I found the solution:

Adding this line into ~/.bashrc file gives correct output
Code:
export LANG=en_US.UTF-8


here is the reference

Thank you all for your replies..


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group