<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-26272527</id><updated>2011-11-27T15:59:33.080-08:00</updated><category term='debian'/><category term='locale'/><category term='linux'/><category term='Eee PC'/><category term='ubuntu'/><category term='vmware'/><title type='text'>Poly Thinker</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://polythinker.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://polythinker.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Poly Thinker</name><uri>http://www.blogger.com/profile/11937064662409821687</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-26272527.post-5352168842087138835</id><published>2008-12-24T16:54:00.000-08:00</published><updated>2008-12-25T18:24:50.156-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Eee PC'/><title type='text'>Installing GCC on Eee PC: A Walkthrough</title><content type='html'>This is a step-by-step walkthrough of how to build and install latest GCC (4.3.2 at the time of writing) from source on Eee PC 900 model with pre-installed Linux. The steps for other models may be similar but there's no way I can test it now.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;0. Why do I need a GCC?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well, why not? I cannot bear the fact that Eee PC does not come with a pre-installed gcc, since this basically says, hey, we don't want you to build your own stuff on it. What a thing to do, considering that they have already provided the assembler (as), linker (ld), pre-processor (cpp),  text editor (vim), GNU make, Perl, Python, and many more!&lt;br /&gt;&lt;br /&gt;The system itself is Xandros based. No problem. But it's the stable release. Err, can't they take a little risk and provide more up-to-date software? Firefox is of version 2.0.0.14 after upgrading, for example, and "Check for Update" is disabled within firefox.&lt;br /&gt;&lt;br /&gt;I may be able to use it to check email for now, but I felt the urge to take control. So here's what I did as a first step to extend the system.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. Preparations&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;1.1 Getting a shell&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am a gnome user, so the user interface looks a bit like maze to me. The first thing I tried in my local retailer was to launch a console program. It took me a good 10 minutes to find a way. Basically you could open a file manager and press Ctrl-T, which would give you a full fledged Konsole. But I later learned that there's an easier way: Just press Ctrl-Alt-T on the main desktop interface and you will get an xterm.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;1.2 Preparing directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My 900 model comes with a claimed 20G solid state disk. It was divided into two partitions, one of them 3.7G mounted as / and and the other 14.7G mounted as /home. The first partition, being used mainly by the pre-installed system, already took most of the space on it. So it's not a good idea to directly install anything there. However, installing everything to user home directory is inconvenient, since you need to modify default prefix when building, and makes installation of binary packages more difficult.&lt;br /&gt;&lt;br /&gt;My solution is to move the entire /usr/local/ in to /home, and create a symbolic link there to refer to the one in /home. The commands to achieve this are:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo mv /usr/local /home&lt;br /&gt;sudo ln -s /home/local /usr/&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;1.3 Getting a binary gcc package&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The fact that Eee PC does not come with a compiler makes things a bit difficult to bootstrap. To compile GCC, you need GCC :)&lt;br /&gt;&lt;br /&gt;The solution is, naturally, to get a minimum binary package from somewhere first. I first thought Debian packages would work, but I was wrong. Debian packages are tagged with an extra string after the normal package name and version number to identify which release it belongs to. This creates dependency problems. After some googling I found the following method to get gcc-4.1.2 from a xandros repository.&lt;br /&gt;&lt;br /&gt;First, add the following line in /etc/apt/sources.list&lt;br /&gt;&lt;br /&gt;&lt;code&gt;deb http://xnv4.xandros.com/xs2.0/pkg/ xs2.0-xn main&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Next, update the list of available packages by&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo apt-get update&lt;br /&gt;sudo apt-get install xandros-archive-keyring&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The second command is just to let the system accept the public key of the xandros repository. After that, install gcc and libc6-dev as follows&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo apt-get install gcc&lt;br /&gt;sudo apt-get install libc6-dev&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;These may prompt you to install extra packages, such as linux-headers, but that's fine, and it won't take too much space. After this I got a working C compiler.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Building GCC&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A detailed instruction of how to build GCC from source can be found at &lt;a href="http://gcc.gnu.org/install/"&gt;http://gcc.gnu.org/install/&lt;/a&gt;. However, many of the steps and options are not relevant here. So I'm going to zoom in to those things that are not the default.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;2.1 Download the source&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Three packages will be needed. First is GCC itself, then GMP, and lastly MPFR. Links can all be found from the gcc instruction page. There are two things to note here. One is that you only need the source of all three packages. GMP and MPFR will be built together with GCC. Second, if you are not so keen to compile Ada and Fortran etc. using gcc, you can just get gcc-core and gcc-g++ packages, which will be about only half of the size of the full version.&lt;br /&gt;&lt;br /&gt;After downloading the source packages, decompress them in the same directory. I used /home/user/sw/. Each of these packages will have their own sub directory (except for gcc-g++ and gcc-core, they will go into the same directory).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;2.2 Building from source&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before you actually start to build, you need to tweak the directories a bit. Suppose you are in /home/user/sw/ (replace this by wherever you decompress the source files). Also, suppose you downloaded gcc-4.3.2, gmp-4.2.4 and mpfr-2.3.2. You can do the following.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;mkdir build&lt;br /&gt;cd gcc-4.3.2&lt;br /&gt;ln -s ../gmp-4.2.4 gmp&lt;br /&gt;ln -s ../mpfr-2.3.2 mpfr&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;After that you can start to configure GCC in the "build" directory as created above  (building inside the source directory is not recommended as stated on the gcc webpage).&lt;br /&gt;&lt;br /&gt;&lt;code&gt;cd /home/user/sw/build&lt;br /&gt;../gcc-4.3.2/configure&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;By default the installation directory prefix is /usr/local/, which can be changed by "--prefix=dir" parameter to the configure script. After that you can start to build and install it.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;make&lt;br /&gt;sudo make install&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Verify that you are using the new gcc by "gcc --version". I had to exit the current xterm and launch a new one to do that because although /usr/local/bin is before everything else in $PATH, somehow when I run gcc it still runs the old version in the existing xterm window.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26272527-5352168842087138835?l=polythinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polythinker.blogspot.com/feeds/5352168842087138835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26272527&amp;postID=5352168842087138835' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/5352168842087138835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/5352168842087138835'/><link rel='alternate' type='text/html' href='http://polythinker.blogspot.com/2008/12/installing-gcc-on-eee-pc-walkthrough.html' title='Installing GCC on Eee PC: A Walkthrough'/><author><name>Poly Thinker</name><uri>http://www.blogger.com/profile/11937064662409821687</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26272527.post-2472979062942787880</id><published>2008-12-18T20:49:00.000-08:00</published><updated>2008-12-18T21:06:45.597-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>When VMware meets Ubuntu</title><content type='html'>VMware is a cool thing. Only after you have a few gigs of RAM and dual/quad-core, that is. Although it is a proprietary technology, it does have a free server version that is tremendously helpful to me, both in daily programming work and casual time-killing. &lt;br /&gt;&lt;br /&gt;Ubuntu is another cool thing, which I enjoy using at the moment. But it has certain ``problems'' (or maybe ``features'' that I'm not used to). One of them pops up when I use VMware server 2.0 on Ubuntu 8.10. &lt;br /&gt;&lt;br /&gt;In short, everything went fine (well, almost), except that I found my UP arrow key is gone, and my DOWN arrow key becomes the Windows key in my guest XP.  &lt;br /&gt;&lt;br /&gt;This was not a new problem. I had the same problem with previous versions of VMware and Ubuntu, but unfortunately forgot what the solution was. I had a one-line script that reads:&lt;br /&gt;&lt;br /&gt;    &lt;code&gt;setxkbmap -rules xorg -layout "us" -model pc&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;which I remember solved one of the previous problems, but it didn't work anymore.&lt;br /&gt;&lt;br /&gt;Googling on VMware and Ubuntu gives me a lot of information, so much so that I couldn't find relevant solution easily. Eventually I came across this howto:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ubuntuforums.org/showthread.php?t=973729"&gt;How to VMWare Server 2.0 on Ubuntu 8.10&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This basically says that adding the following line in &lt;span style="font-style:italic;"&gt;/etc/vmware/config&lt;/span&gt; would solve the problem for VMware server (VMware Workstation requires a bit more work).&lt;br /&gt;&lt;br /&gt;    &lt;code&gt;xkeymap.nokeycodeMap = TRUE&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This one-line solution solved my keyboard problem. I'm really glad that someone took the trouble to write this howto to help people like me, who have problems remembering every detail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26272527-2472979062942787880?l=polythinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polythinker.blogspot.com/feeds/2472979062942787880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26272527&amp;postID=2472979062942787880' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/2472979062942787880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/2472979062942787880'/><link rel='alternate' type='text/html' href='http://polythinker.blogspot.com/2008/12/when-vmware-meets-ubuntu.html' title='When VMware meets Ubuntu'/><author><name>Poly Thinker</name><uri>http://www.blogger.com/profile/11937064662409821687</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26272527.post-4730081850442495982</id><published>2008-12-15T02:41:00.000-08:00</published><updated>2008-12-19T02:53:19.955-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='locale'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Fine Tuning Locale in Ubuntu GNU/Linux</title><content type='html'>&lt;a href="http://isis.poly.edu/~qiming/fine-tuning-ubuntu-locale.html"&gt;http://isis.poly.edu/~qiming/fine-tuning-ubuntu-locale.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;0. Background&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A few years ago, I was quite frustrated in configuring locale settings in Debian when I switched from RedHat (not that it was any easier for RedHat), so much so that I ended up writing my own &lt;a href="http://polythinker.blogspot.com/2006/04/chinese-debian-mini-howto.html"&gt;mini howto&lt;/a&gt; on it, hoping it would be useful to folks like me.&lt;br /&gt;&lt;br /&gt;I also tried Gentoo for a couple of years, but gave up the idea of compiling everything from the source and the long process of installation (I could have used the binary packages but that would sort of defeat the purpose, wouldn't it?). Configuring locale in Gentoo was quite straight forward, though.&lt;br /&gt;&lt;br /&gt;Recently I lean more on Ubuntu, mainly for its effortless installation and configuration processes. Although I lost a little of control as what should and should not be installed on my system, but with cheap hard drives and CPUs today, that seemed to be a reasonable trade-off.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. Locale configuration problems in Ubuntu&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Locale configuration in Ubuntu was, as in Gentoo, quite straight forward, provided that you use the default gdm, since it allows you to specify a locale at the login window, and Gnome handles locales pretty nicely. For example, scim would be run (and working nicely) when I chose "zh_CN.UTF-8" as my locale. It should be pretty much the same for kdm and KDE but I didn't try.&lt;br /&gt;&lt;br /&gt;However, a couple of little tricks I used to play with Debian wouldn't work in Ubuntu. For example, in Debian I could have set the locale to "C" and still have scim working on my browser and gnome-terminal, whereas in Ubuntu scim simply wouldn't work that way.&lt;br /&gt;&lt;br /&gt;Also, when I set the locale to zh_CN, I lost control of menu displays and error messages. Although it wouldn't hurt to read error messages in Chinese, it sometimes requires a bit of guess work to decipher what they really mean, especially those errors and warnings emitted from gcc.&lt;br /&gt;&lt;br /&gt;Ocasionally you would need to copy/paste the messages to your browser to google about a solution to your problem, and error messages in Chinese (which is not standardized in anyway) just wouldn't help.&lt;br /&gt;&lt;br /&gt;Most importantly, when you want to view man pages, having a locale other than "C" could make it complain and refuse to work. Same goes for programs like aspell.&lt;br /&gt;&lt;br /&gt;In Debian I could put something in /etc/X11/Xsession.d/ to fine tune the locale settings (as I explained in the mini howto) But it didn't seem to work in Ubuntu (at last for for some release versions that I tried). In some cases I could work it around using the enstart.sh script as in the mini howto, but it's troublesome.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Fine Tuning&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the end, I figured out that /etc/environment is the right place to place the locale settings. Basically I inserted the following lines into the file but leave "LANG" and "LANGUAGE" unchanged:&lt;br /&gt;&lt;br /&gt;LC_MESSAGES="C"&lt;br /&gt;LC_COLLATE="C"&lt;br /&gt;LC_CTYPE="C"&lt;br /&gt;LC_TIME="C"&lt;br /&gt;LC_NUMERIC="C"&lt;br /&gt;LC_MONETARY="C"&lt;br /&gt;LC_PAPER="C"&lt;br /&gt;LC_NAME="C"&lt;br /&gt;LC_ADDRESS="C"&lt;br /&gt;LC_TELEPHONE="C"&lt;br /&gt;LC_MEASUREMENT="C"&lt;br /&gt;LC_IDENTIFICATION="C"&lt;br /&gt;&lt;br /&gt;(EDIT: Actually, only LC_MESSAGES is required in most cases. Putting all of them here may confuse Ubuntu as I recently found out.)&lt;br /&gt;&lt;br /&gt;After that, log out of Gnome (which seems to have the side effect of restarting gdm, otherwise I may have to restart it manually), and log in back again, and menu items, error messages, man pages, etc., would be displayed in English, without affecting scim.&lt;br /&gt;&lt;br /&gt;A minor (but surprising!) problem is that the /etc/environment file does not support usual variable substitution as in a shell script. So I cannot put something like&lt;br /&gt;&lt;br /&gt;ENCODING="C"&lt;br /&gt;LC_MESSAGES=$ENCODING&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;as I did in the mini howto. What happens to the Least Surprise priciple, I wonder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26272527-4730081850442495982?l=polythinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polythinker.blogspot.com/feeds/4730081850442495982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26272527&amp;postID=4730081850442495982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/4730081850442495982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/4730081850442495982'/><link rel='alternate' type='text/html' href='http://polythinker.blogspot.com/2008/12/fine-tuning-locale-in-ubuntu-gnulinux.html' title='Fine Tuning Locale in Ubuntu GNU/Linux'/><author><name>Poly Thinker</name><uri>http://www.blogger.com/profile/11937064662409821687</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26272527.post-114524610219872576</id><published>2006-04-16T19:28:00.000-07:00</published><updated>2008-12-15T02:47:15.106-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><category scheme='http://www.blogger.com/atom/ns#' term='locale'/><title type='text'>Chinese Debian Mini Howto</title><content type='html'>&lt;a href="http://isis.poly.edu/~qiming/chinese-debian-mini-howto.html"&gt;http://isis.poly.edu/~qiming/chinese-debian-mini-howto.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;0. Introduction&lt;/span&gt;&lt;br /&gt;The purpose of this mini howto is to help users of Debian GNU/Linux to build a minimum Chinese environment, so that they can read and input Chinese in their systems. &lt;br /&gt;&lt;br /&gt;To support Chinese language display and input under Debian GNU/Linux, you will need to do the following basic steps.&lt;br /&gt;*&lt;a href="#Generating_Locales"&gt;Generate relevant locales&lt;/a&gt;&lt;br /&gt;*&lt;a href="#Installing_Fonts"&gt;Install Chinese fonts&lt;/a&gt;&lt;br /&gt;*&lt;a href="#Installing_IM"&gt;Install an input method (IM) engine&lt;/a&gt;&lt;br /&gt;*&lt;a href="#Setting_Locale"&gt;Set locale&lt;/a&gt;&lt;br /&gt;*&lt;a href="#Applications"&gt;Adjust application settings (if necessary)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the rest of this text, I will explain these steps one by one. Most of the commands below need to be run in a terminal with root privilege.&lt;br /&gt;&lt;br /&gt;&lt;a name="Generating_Locales"&gt;&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;1. Generating Locales&lt;/span&gt;&lt;br /&gt;Run &lt;code&gt;&lt;b&gt;dpkg-reconfigure locales&lt;/b&gt;&lt;/code&gt;, and choose the following items.&lt;br /&gt;*en_US ISO-8859-1&lt;br /&gt;*zh_CN GB2312&lt;br /&gt;*zh_CN.GBK GBK&lt;br /&gt;*zh_CN.UTF-8 UTF-8&lt;br /&gt;*zh_TW BIG5&lt;br /&gt;*zh_TW.UTF-8 UTF-8&lt;br /&gt;Some of these are optional. For example, if you are using Simplified Chinese only, you would not need the last two items. After this you will be prompted for the default locale you want to use.&lt;br /&gt;&lt;br /&gt;NOTE: Sometimes you need to reboot to get the new locales working. To avoid potential problems, it is strongly recommended that you get this correct from the beginning when you install your system.&lt;br /&gt;&lt;br /&gt;&lt;a name="Installing_Fonts"&gt;&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;2. Installing Chinese Fonts&lt;/span&gt;&lt;br /&gt;Install at least the following free fonts. Each entry below is of the form &lt;em&gt;package_name (font_name)&lt;/em&gt;.&lt;br /&gt;*ttf-arphic-gbsn00lp (AR PL SungtiL GB)&lt;br /&gt;*ttf-arphic-gkai00mp (AR PL KaitiM GB)&lt;br /&gt;*ttf-arphic-bsmi00lp (AR PL Mingti2L Big5)&lt;br /&gt;*ttf-arphic-bkai00mp (AR PL KaitiM Big5)&lt;br /&gt;The first two are for Simplified Chinese, and the other two for Traditional Chinese.&lt;br /&gt;&lt;br /&gt;These packages can be installed by running &lt;br /&gt;&lt;code&gt;&lt;b&gt;apt-get install ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gbsn00lp&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;&lt;br /&gt;There are other fonts available. You can find them by searching for "xfonts" using &lt;em&gt;dselect&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a name="Installing_IM"&gt;&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;3. Installing Input Method (IM) Engine(s)&lt;/span&gt;&lt;br /&gt;You will need an IM engine to input Chinese characters under X. There are a few IMs around, including &lt;em&gt;xcin, chinput, scim&lt;/em&gt;, etc. Personally I found scim a good tool. &lt;br /&gt;&lt;br /&gt;There are several packages related to scim. The easiest way to install it is by running &lt;br /&gt;&lt;code&gt;&lt;b&gt;apt-get install scim scim-chinese scim-tables-zh&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;The package names may change in the future (as they did in the past). In that case, you can search for packages beginning with "scim" using &lt;em&gt;dselect&lt;/em&gt;, examine their descriptions, and choose the input methods you need. After that &lt;em&gt;dselect&lt;/em&gt; will do the rest of the job by selecting all dependent packages.&lt;br /&gt;&lt;br /&gt;After that, create a new file &lt;em&gt;&lt;b&gt;/etc/X11/Xsession.d/95xinput&lt;/b&gt;&lt;/em&gt; with the following content.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/usr/bin/scim -d&lt;br /&gt;XMODIFIERS="@im=SCIM"&lt;br /&gt;export XMODIFIERS&lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;This script will be run every time X windows starts. In case you want to be more flexible, you can put something more complicated in the file. For example,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;case "$LANG" in&lt;br /&gt;zh_TW*)&lt;br /&gt;    /usr/bin/scim -d&lt;br /&gt;    XMODIFIERS="@im=SCIM"&lt;br /&gt;    ;;&lt;br /&gt;zh_CN*)&lt;br /&gt;    /usr/bin/scim -d&lt;br /&gt;    XMODIFIERS="@im=SCIM"&lt;br /&gt;    ;;&lt;br /&gt;esac&lt;br /&gt;export XMODIFIERS&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This takes effect only when you restart X. The simplest way to do that is to press "Ctrl-Alt-BackSpace".&lt;br /&gt;&lt;br /&gt;To use scim, simply press "Ctrl-Space", and a small window will appear at the lower right corner of the desktop.&lt;br /&gt;&lt;br /&gt;It is advisable that you configure scim (right click on its icon on the panel, then configure) and remove all unwanted input methods. You will need to restart scim (probably X, too) to make this to take effect.&lt;br /&gt;&lt;br /&gt;&lt;a name="Setting_Locale"&gt;&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;4. Setting Locale&lt;/span&gt;&lt;br /&gt;It is highly recommended that you use &lt;em&gt;&lt;b&gt;gdm&lt;/b&gt;&lt;/em&gt; or &lt;em&gt;&lt;b&gt;kdm&lt;/b&gt;&lt;/em&gt; as your X display manager, because then you will be able to select your language settings at the login window, which can be different from system default, and can be different for different login.&lt;br /&gt;&lt;br /&gt;If you are using a X display manager that does not support this, you will have to put an additional line such as&lt;br /&gt;&lt;code&gt;&lt;b&gt;export LANG=zh_CN.gb2312&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;in &lt;em&gt;/etc/X11/Xsession.d/95xinput&lt;/em&gt;.&lt;br /&gt;NOTE: It would not work if you run this after you login. You will need to restart X for this to work.&lt;br /&gt;&lt;br /&gt;REMARK: One "side effect" of this is that once you set the language to be Chinese, then all the menu become Chinese. For those who want to keep the English menu but still want to view/input Chinese, you can set locale to be zh_CN.gb2312, but change the settings for some environment variables. For example, I have the following lines in the above file.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ENCODING="en_US"&lt;br /&gt;#export LC_ALL=$ENCODING&lt;br /&gt;export LC_MESSAGES=$ENCODING&lt;br /&gt;#export LC_COLLATE=$ENCODING&lt;br /&gt;#export LC_CTYPE=$ENCODING&lt;br /&gt;export LC_TIME=$ENCODING&lt;br /&gt;export LC_NUMERIC=$ENCODING&lt;br /&gt;#export LC_MONETARY=$ENCODING&lt;br /&gt;#export LC_PAPER=$ENCODING&lt;br /&gt;#export LC_NAME=$ENCODING&lt;br /&gt;export LC_ADDRESS=$ENCODING&lt;br /&gt;export LC_TELEPHONE=$ENCODING&lt;br /&gt;export LC_MEASUREMENT=$ENCODING&lt;br /&gt;export LC_IDENTIFICATION=$ENCODING&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then I got English display of menu, time and date, etc. You should comment/uncomment these items according to your needs.&lt;br /&gt;&lt;br /&gt;Note that "scim" works fine no matter what locale you choose.&lt;br /&gt;&lt;br /&gt;&lt;a name="Applications"&gt;&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;5. Application Settings&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.1 Web Browsers&lt;/span&gt;&lt;br /&gt;For applications such as Mozilla (1.7) and/or other browsers, usually you do not have to change much. If a Chinese webpage does not display correctly, try to check if the character encoding is correct, and make sure that you have installed the corresponding fonts.&lt;br /&gt;&lt;br /&gt;For Mozilla version 1.6, there are some locale packages such as &lt;em&gt; mozilla-locale-zh-cn&lt;/em&gt; or &lt;em&gt;mozilla-locale-zh-tw&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;For Mozilla-Firefox, you might need to install one of the &lt;em&gt; mozilla-firefox-locale-zh-cn&lt;/em&gt; or &lt;em&gt; mozilla-firefox-locale-zh-tw&lt;/em&gt; packages.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.2 Editors&lt;/span&gt;&lt;br /&gt;My favorite text editor is VIM with GTK support, or simply &lt;em&gt;gvim&lt;/em&gt;. For gvim to display Chinese characters correctly, just add the following lines to &lt;em&gt;&lt;b&gt;$HOME/.gvimrc&lt;/b&gt;&lt;/em&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;set enc=euc-cn&lt;br /&gt;set tenc=euc-cn&lt;br /&gt;set fileencoding=euc-cn&lt;br /&gt;set guifont=AR\ PL\ KaitiM\ GB\ 12&lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;The last line specifies the font and the font size to use. You can change it to any of the four fonts as in Section 2 above, and adjust the font size until you feel comfortable.&lt;br /&gt;&lt;br /&gt;Note that even when you set &lt;code&gt;LC_MESSAGE&lt;/code&gt; to &lt;code&gt;en_US&lt;/code&gt;, gvim might still display Chinese menu if your locale is set to Chinese. In this case, you need a bit trick here.&lt;br /&gt;&lt;br /&gt;Firstly, you need to create a file with the content something like the following.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;# Start application $1 with English environment&lt;br /&gt;&lt;br /&gt;if [ -z "$1" ]; then&lt;br /&gt;  echo "Usage: $0 app arg1 arg2 ... "&lt;br /&gt;  exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;export LANG=en_US&lt;br /&gt;&lt;br /&gt;PROG=$1&lt;br /&gt;shift&lt;br /&gt;exec $PROG $*&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Let us call this file &lt;b&gt;&lt;code&gt;enstart.sh&lt;/code&gt;&lt;/b&gt;, and put the file in a directory that is in your &lt;code&gt;$PATH&lt;/code&gt;, e.g., &lt;code&gt;/usr/local/bin&lt;/code&gt;. Make sure that it is executable by running &lt;code&gt;chmod +x /usr/local/bin/chstart.sh&lt;/code&gt; in a terminal.&lt;br /&gt;&lt;br /&gt;This small shell script will set &lt;code&gt;$LANG&lt;/code&gt; so that the application it runs would think that it is running in a full English system.&lt;br /&gt;&lt;br /&gt;To run gvim, we run &lt;code&gt;&lt;b&gt;enstart.sh gvim&lt;/b&gt;&lt;/code&gt; instead. You can add this to your desktop/panel shortcut, or make it an alias.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.3 Terminal Emulators&lt;/span&gt;&lt;br /&gt;&lt;em&gt;RXVT&lt;/em&gt; (www.rxvt.org) is a nice terminal-emulator that intends to replace xterm.&lt;br /&gt;It has a variant &lt;em&gt;rxvt-ml&lt;/em&gt; which supports display of Chinese and Japanese characters.&lt;br /&gt;&lt;br /&gt;The &lt;em&gt;gnome-terminal&lt;/em&gt;, the default terminal emulator in the GNOME environment, supports Chinese by selecting the character encoding from the terminal menu.&lt;br /&gt;&lt;br /&gt;The default terminal emulator in KDE, &lt;em&gt;Konsole&lt;/em&gt;, works fine with Chinese automatically if the locale is set correctly. You can also select/change character encoding from the menu.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.4 Display of Chinese File Names in FAT Partitions&lt;/span&gt;&lt;br /&gt;You will need kernel support for this. To be able to mount a FAT (either 16 or 32 bit), you will need the following module.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;fat&lt;br /&gt;vfat&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To display Chinese characters properly, you will need at least one of the following modules:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;nls_cp936 (for simplified Chinese)&lt;br /&gt;nls_cp950 (for traditional Chinese)&lt;br /&gt;nls_utf8 (for Unicode characters)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then in the file &lt;em&gt;&lt;b&gt;/etc/fstab&lt;/b&gt;&lt;/em&gt;, add another line like the following&lt;br /&gt;&lt;code&gt;/dev/hda5 /mnt/dos vfat noauto,user,codepage=936,iocharset=cp936 0 0&lt;/code&gt;&lt;br /&gt;for simplified Chinese, and replace the number 936 to 950 for traditional Chinese, and to utf8 for Unicode characters.&lt;br /&gt;&lt;br /&gt;NOTE: you should change the partition (/dev/hda5) and mount point (/mnt/dos) to the partition you want to mount, and the directory you want it to be mounted to, respectively. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.5 XMMS&lt;/span&gt;&lt;br /&gt;Unfortunately, unlike other programs, my XMMS does not display Chinese file/song names correctly, even when I set both the system locale and the language option of gdm to be &lt;code&gt;zh_CN.gb2312&lt;/code&gt;, which is quite weird. My guess is that this has to do with the locale I set when I first install the system.&lt;br /&gt;&lt;br /&gt;Fortunately, similar trick as in the case of gvim can be applied here, but this time we want to run with Chinese support. Let us create the following file and call it &lt;code&gt;&lt;b&gt;chstart.sh&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;# Start application $1 with Chinese environment&lt;br /&gt;&lt;br /&gt;if [ -z "$1" ]; then&lt;br /&gt;  echo "Usage: $0 app arg1 arg2 ... "&lt;br /&gt;  exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;export LANG=zh_CN.gb2312&lt;br /&gt;&lt;br /&gt;PROG=$1&lt;br /&gt;shift&lt;br /&gt;exec $PROG $*&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To run XMMS, just type &lt;code&gt;&lt;b&gt;chstart.sh xmms&lt;/b&gt;&lt;/code&gt; in a terminal, or create a shortcut on desktop/panel to do it, or use an alias.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.6 Instant Messengers&lt;/span&gt;&lt;br /&gt;It was actually amazing to find out that popular instant messengers such as AMSN and Yahoo Messenger do not support Chinese. It is possible to input Chinese in YM, but difficult to make it displayed properly. AMSN simply stops taking any keyboard input when the locale is set to Chinese.&lt;br /&gt;&lt;br /&gt;A work-around for AMSN is to use the &lt;code&gt;&lt;b&gt;enstart.sh&lt;/b&gt;&lt;/code&gt; to start it instead (but of course you cannot expect to input Chinese with it).&lt;br /&gt;&lt;br /&gt;Fortunately, there are instant messengers that do support Chinese. Skype is an example, but only works when gdm/kdm has the locale set to &lt;code&gt;zh_CN.gb2312&lt;/code&gt; otherwise it will not work even if you start it with the &lt;code&gt;chstart.h&lt;/code&gt; script above.&lt;br /&gt;&lt;br /&gt;Pidgin (then GAIM) is another cute IM that was reported to work with Chinese. It is compatible with AIM, Yahoo! Messenger, MSN Messenger, Google Talk (Jabber), etc. It now even supports QQ, the most popular ICQ-like messenger in China. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.7 Java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(This section is contributed by Guohan Lu, lguohan at gmail.com)&lt;br /&gt;&lt;br /&gt;One of things trouble me a lot is the Java on Debian do not support Chinese natively. I got the solution to Java1.5 recently (tested for GB2312).&lt;br /&gt;&lt;br /&gt;Here is the way (two steps):&lt;br /&gt;1. make a directory fallback under &lt;code&gt;JavaHome/lib/fonts/&lt;/code&gt;&lt;br /&gt;2. add a Chinese TrueType or Type 1 font under fallback&lt;br /&gt;&lt;br /&gt;An example:&lt;br /&gt;&lt;code&gt;&lt;b&gt;&lt;br /&gt;  mkdir /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback&lt;br&gt;&lt;br /&gt;  ln -s /usr/share/fonts/truetype/arphic/gbsn00lp.ttf .&lt;br /&gt;&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Note the trailing dot at the end of the above line. &lt;br /&gt;&lt;br /&gt;Some explanations for the fallback:&lt;br /&gt;&lt;br /&gt;"... If the runtime environment has a directory lib/fonts/fallback and this directory contains valid TrueType or Type 1 fonts, the runtime automatically adds these fonts as fallback fonts for 2D rendering..."&lt;br /&gt;--- from &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html"&gt;http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note: This solution should be considered as quick and dirty, the best solution would be change the fontconfig file for Java. But, I haven't figured out that yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26272527-114524610219872576?l=polythinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polythinker.blogspot.com/feeds/114524610219872576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26272527&amp;postID=114524610219872576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/114524610219872576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26272527/posts/default/114524610219872576'/><link rel='alternate' type='text/html' href='http://polythinker.blogspot.com/2006/04/chinese-debian-mini-howto.html' title='Chinese Debian Mini Howto'/><author><name>Poly Thinker</name><uri>http://www.blogger.com/profile/11937064662409821687</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
