使用的是Ubuntu 9.10发行版,找了好半天中文输入法,发现目前最好/最新的是ibus(前身是鼎鼎大名的scim-python,对于我这个linux小白来说,并不是鼎鼎大名的...),严格来说它不是一个输入法,而是一个输入法框架,9.10自带的ibus里有N多国家的输入法(基于ibus框架)。ubuntu9.10里面ibus自带的中文PinYin输入法好像一开始不能用...(拿不准...),必须去Preferences里面的IBus Preferences里面的Input Method中自己添加“汉语-PinYin”输入法,如果开始没有,需要安装ibus-pinyin,见下面的第4步。

在网上找了点资料,在ibus已经加入到Ubuntu的源了,如果需要,使用下面的命令进行安装:

  1. sudo apt-get update                                   更新软件包列表
  2. sudo apt-get install ibus                            安装ibus框架
  3. sudo apt-get install ibus ibus-table        安装某些输入法引擎基础,如果仅仅想使用拼音输入法,可以跳过此步,拼音输入法不需要依赖ibus-table。某些输入法,如五笔,依赖ibus-table。
  4. sudo apt-get install ibus ibus-pinyin       安装拼音输入法引擎,发现很好用啊,哈哈

由于安装和卸载软件是使用的必须前提,所以这里对apt命令进行一些总结。在总结之前,还得对ubuntu的软件源的地址进行说明,为了达到好的下载源的速度,最好选一个最快的软件源,目前来说http://ubuntu.srt.cn是最快的,ubuntu自己提供了检测的功能,可以自动检测(choose a download server -> select best server)。

关于apt-get命令的详细而简单的说明,是《AptGetHowTo》。注意,使用apt-get命令必须要用root权限。这里,摘抄了最常用的命令....如下

Installation commands

  • apt-get install <package_name> 
    This command installs a new package.
  • apt-get build-dep <package_name> 

    This command searches the repositories and installs the build dependencies for <package_name>. If the package is not in the repositories it will return an error.

  • aptitude install <package_name>

    Aptitude is a [http://en.wikipedia.org/wiki/Ncurses Ncurses] viewer of packages installed or available. Aptitude can be used from the command line in a similar way to apt-get. See man aptitude for more information.

  • APT and aptitude will accept multiple package names as a space delimited list. For example:
    apt-get install <package1_name> <package2_name> <package3_nam
    
    
    
  • apt-cache search <search_term>

    This command will find packages that include <search_term>.

  • dpkg -l *<search_term>*

    This will find packages whose names contain <search_term>. Similar to apt-cache search, but also shows whether a package is installed on your system by marking it with ii (installed) and un (not installed).

  • apt-cache show <package_name>

    This command shows the description of package <package_name> and other relevant information including version, size, dependencies and conflicts.

 

Typical usage example

I want to feel the wind in my hair, I want the adrenaline of speed. So lets install a racing game. But what racing games are available?

apt-cache search racing game

It gives me a lot of answers. I see a game named "torcs". Lets get some more information on this game.

apt-cache show torcs

Hmmm... it seems interesting. But is this game not already installed on my computer? And what is the available version? Is it from Universe or main?

apt-cache policy torcs

Ok, so now, let's install it!

apt-get install torcs

What is the command I must type in the console to launch this game? In this example, it's straightforward ("torcs"), but that's not always the case. One way of finding the name of the binary is to look at what files the package has installed in "/usr/bin". For games, the binary will be in "/usr/games". For administrative programs, it's in "/usr/sbin".

dpkg -L torcs | grep /usr/games/

The first part of the command display all files installed by the package "torcs" (try it). With the second part, we ask to only display lines containing "/usr/games/".

Hmmm, that game is cool. Maybe there are some extra tracks?

apt-cache search torcs

But I'm running out of space. I will delete the apt cache!

apt-get clean

Oh no, my mother asked me to remove all games from this computer. But I want to keep the configuration files so I can simply re-install it later.

apt-get remove torcs

If I want to also remove config files :

apt-get purge torcs

文章来源:http://localhost/wp2/?p=180