2009年5月2日星期六

Ubuntu 9.04 On ThinkPad X61.... Enjoy it! <1>

1. 什么是 Ubuntu?
Ubuntu 是一个由 社区 开发的,适用于笔记本电脑、 桌面电脑 和 服务器。 无论您是在家庭、学校还是工作时使用,Ubuntu 都包含了您所需的所有程序:无论是文字处理和电子邮件,还是 Web 服务和编程工具。
Ubuntu 永远 免费。您无需支付任何许可费用。您可以下载、使用以及与您的朋友、家庭、同学或同事分享,而绝对无需任何代价。
Link: 官方首页 官方论坛

2. Ubuntu是众多Linux发行版本中最喜欢的一款了,也是最初接触的一款,一知道出了9.04正式版,马上下载镜像ISO,通过量产U盘直接安装 windows & Ubuntu双系统<因为某些原因,只能向windows妥协>, 安装过程也是一如既往的傻瓜式,具体就不多说了。
Tips:
<1> 像我一样喜欢En界面的话,安装时语言选En(US)就可以了,输入法,中文支持等系统安装好之后再装
<2> 值得注意的地方就是磁盘分区那一步,一定要选择手动管理磁盘,否则..一不小心..珍藏多年的海量电影就化为泡影..欲哭无泪吧


3. 安装完Ubuntu 9.04之后做些什么呢?
3.1 最最首要做得是添加合适的源sources.list, 不同的网络环境下访问源的速度也是不同的,比如网通的用户就访问电信的源,速度慢是正常的,所以我们添加源的目的是?得到更快的下载速度!这样会对后面的维护起到事半功倍的效果哦,hoho
-->点击我查看Wiki源列表<-- 添加源是请选择当前使用的发行版本(9.04)对号入座 <1> 现备份一下当前于sources.list以免出错:sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
<2> 编辑list, 在最上面加上更快更好的源: sudo gedit /etc/apt/sources.list
我是上海有线通用户 ,用了 Mirror.lupaworld.com更新服务器(浙江省杭州市双线服务器):
deb http://mirror.lupaworld.com/ubuntu jaunty main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu jaunty-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu jaunty-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu jaunty-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu jaunty-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu jaunty main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu jaunty-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu jaunty-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu jaunty-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu jaunty-proposed main restricted universe multiverse

<3> 保存sources.list之后别忘了刷新源列表: sudo apt-get update
Tips:
<1> 怎么知道哪个源速度快?尽量选同网的,电信选电信,网通选网通,另外可以通过ping源地址,简单的查看连接速度
<2> 如果list里有龟速的源,可以直接删除掉,但是如果没有胆量,可以在前面加上#来屏蔽掉,嘿嘿

3.2 添加字体,习惯了雅黑
<1> 下载或者从windows系统copy各种喜欢的ttf字体(比如雅黑msyh.ttf)放在一个文件夹内
<2> Terminal终端里执行下面命令,将需要的字体复制到系统的字体目录下,然后重建字体缓存就可以了
sudo mkdir /usr/share/fonts/ttf
sudo cp /存放ttf字体的路径/* /usr/share/fonts/ttf
cd /usr/share/fonts/ttf
sudo chmod 744 *
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -f -v
exit

<3> 这会儿你就会发现各种可以进行Fonts设置的地方都可以找到你需要的字体了

3.3 习惯了windows桌面,怎么在Ubuntu桌面也放上我的电脑 回收站这些快捷方式呢?
<1> 终端运行gconf-editor,会出来一个类似windows下regedit注册表的管理器Configuration Editor
<2> 在/app/nautilus/desktop右边发现computer_icon_visible这类的key, 打上勾桌面就会有computer icon了,同理network icon/trash icon...

Tips:
可以通过System-->Preferences-->Main Menu, 把System Tool里的Configuration Editor点开,以后就不需要记命令可以直接在左上角系统菜单里找到它了

3.4 安装中文输入法
输入法SCIM是自带的,不过里面没有pinyin而已,so......要做的是: sudo apt-get install scim-pinyin 安装完成之后重启或者登出一下就可以了
Tips:
因为是En系统,也许你会发现,通过快捷键Ctrl+Space无法调出中文拼音,怎么办? System-->Preferences-->Language Support, 勾上"Use input method engines (IME) to enter complex characters" ,设置将会在下次登录起效,All changes take effect next time you log in :).


3.5 安装视频播放器及解码
<1> 最喜欢的当然是万能的Mplayer以及她的前端Smplayer,舒服!
安装:sudo apt-get install mplayer-fonts mplayer mplayer-skins mozilla-mplayer smplayer
在开始用它进行视频播放前还需要进行以下设置(先启动它),然後右键弹出主菜单 -> Preferences/属性 -> Video/视频,在"Available drivers/可用驱动"中选择"x11"或"xv",>在同一窗口下半部份钩上"允许掉帧/Enable frame dropping"。
<2> 有了播放器还是不能放rmvb的,还需要解码器codecs
wget http://www1.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar -xvjf essential-20071007.tar.bz2
sudo mv essential-20071007 /usr/lib/codecs
Tips:
如果播放rmvb有声音没图像: sudo apt-get install libstdc++5


3.6 Conky, 这个太棒了,是我必需的,可以让你的系统信息在桌面一目了然,而且可以任意配置
<1> 安装: sudo apt-get install conky
<2> 在主目录下建立配置文件".conkyrc" 隐藏文件,别忘了点名的"." , 内容嘛 去百度吧 以后再说,先附上我的 ^0^
代码:
# set to yes if you want Conky to be forked in the background
background no

cpu_avg_samples 2
net_avg_samples 2

out_to_console no

# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
#font 6x10
#font 7x13
#font 8x13
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont sans:size=9

own_window_transparent no
#own_window_colour hotpink
# Text alpha when using Xft
xftalpha 0.8

# on_bottom yes

# mail spool
mail_spool $MAIL

# Update interval in seconds
update_interval 1
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar
own_window_type override

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 260 5
maximum_width 400

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders no

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white

# Text alignment, other possible values are commented
#alignment top_left
#minimum_size 10 10
gap_x 20
gap_y 60
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text

# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# none, xmms, bmp, audacious, infopipe (default is none)
# xmms_player bmp

# boinc (seti) dir
# seti_dir /opt/seti

# Possible variables to be used:
#
# Variable Arguments Description
# acpiacadapter ACPI ac adapter state.
# acpifan ACPI fan state
# acpitemp ACPI temperature.
# adt746xcpu CPU temperature from therm_adt746x
# adt746xfan Fan speed from therm_adt746x
# battery (num) Remaining capasity in ACPI or APM
# battery. ACPI battery number can be
# given as argument (default is BAT0).
# buffers Amount of memory buffered
# cached Amount of memory cached
# color (color) Change drawing color to color
# cpu CPU usage in percents
# cpubar (height) Bar that shows CPU usage, height is
# bar's height in pixels
# downspeed net Download speed in kilobytes
# downspeedf net Download speed in kilobytes with one
# decimal
# exec shell command Executes a shell command and displays
# the output in torsmo. warning: this
# takes a lot more resources than other
# variables. I'd recommend coding wanted
# behaviour in C and posting a patch :-).
# execi interval, shell Same as exec but with specific interval.
# command Interval can't be less than
# update_interval in configuration.
# fs_bar (height), (fs) Bar that shows how much space is used on
# a file system. height is the height in
# pixels. fs is any file on that file
# system.
# fs_free (fs) Free space on a file system available
# for users.
# fs_free_perc (fs) Free percentage of space on a file
# system available for users.
# fs_size (fs) File system size
# fs_used (fs) File system used space
# hr (height) Horizontal line, height is the height in
# pixels
# i2c (dev), type, n I2C sensor from sysfs (Linux 2.6). dev
# may be omitted if you have only one I2C
# device. type is either in (or vol)
# meaning voltage, fan meaning fan or temp
# meaning temperature. n is number of the
# sensor. See /sys/bus/i2c/devices/ on
# your local computer.
# kernel Kernel version
# loadavg (1), (2), (3) System load average, 1 is for past 1
# minute, 2 for past 5 minutes and 3 for
# past 15 minutes.
# machine Machine, i686 for example
# mails Mail count in mail spool. You can use
# program like fetchmail to get mails from
# some server using your favourite
# protocol. See also new_mails.
# mem Amount of memory in use
# membar (height) Bar that shows amount of memory in use
# memmax Total amount of memory
# memperc Percentage of memory in use
# new_mails Unread mail count in mail spool.
# nodename Hostname
# outlinecolor (color) Change outline color
# pre_exec shell command Executes a shell command one time before
# torsmo displays anything and puts output
# as text.
# processes Total processes (sleeping and running)
# running_processes Running processes (not sleeping),
# requires Linux 2.6
# shadecolor (color) Change shading color
# stippled_hr (space), Stippled (dashed) horizontal line
# (height)
# swapbar (height) Bar that shows amount of swap in use
# swap Amount of swap in use
# swapmax Total amount of swap
# swapperc Percentage of swap in use
# sysname System name, Linux for example
# time (format) Local time, see man strftime to get more
# information about format
# totaldown net Total download, overflows at 4 GB on
# Linux with 32-bit arch and there doesn't
# seem to be a way to know how many times
# it has already done that before torsmo
# has started.
# totalup net Total upload, this one too, may overflow
# updates Number of updates (for debugging)
# upspeed net Upload speed in kilobytes
# upspeedf net Upload speed in kilobytes with one
# decimal
# uptime Uptime
# uptime_short Uptime in a shorter format
#
# seti_prog Seti@home current progress
# seti_progbar (height) Seti@home current progress bar
# seti_credit Seti@hoome total user credit




# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument
#${font Dungeon:style=Bold:pixelsize=10}I can change the font as well
#${font Verdana:size=10}as many times as I choose
#${font Perry:size=10}Including UTF-8,
# stuff after 'TEXT' will be formatted on screen


TEXT
${font Radio Space:size=18}Bruce's Desktop${hr 1}${color}
${font Radio Space:size=12}${color white}${time %Y-%m-%d %a}.
${font Radio Space:size=44}${time %H:%M}$font

${color white}WEATHER ${hr 1}${color}

${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=CN}
${font Weather:size=44}${color gold}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=WF}${font}${color}${voffset -20}${offset 18}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=CC}${offset 10}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=HT}${offset 10}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=WS} ${font Arrows:size=10}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=BF}$font
${offset 60}Sol: ${color}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=SR}-${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=SS}
${font Weather:size=26}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=WF --startday=1 --endday=4 --spaces=1}${font}
${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0116 --datatype=HT --startday=1 --endday=4 --spaces=11}

${color white}SYSTEM ${hr 1}${color}

Hostname: $alignr$nodename
Kernel: $alignr$kernel
Uptime: $alignr$uptime
Temperature: ${alignr}${acpitemp}°C

CPU: ${alignr}${freq_dyn} MHz
Processes: ${alignr}$processes ($running_processes running)
Load: ${alignr}$loadavg

CPU1 ${alignr}${cpu cpu1}%
${cpubar 4 cpu1}
CPU2 ${alignr}${cpu cpu2}%
${cpubar 4 cpu2}
RAM ${alignr}$mem / $memmax ($memperc%)
${membar 4}

Highest CPU $alignr CPU% MEM%
${top name 1}$alignr${top cpu 1}${top mem 1}
${top name 2}$alignr${top cpu 2}${top mem 2}
${top name 3}$alignr${top cpu 3}${top mem 3}

Highest MEM $alignr CPU% MEM%
${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}

${color white}FILE SYSTEM ${hr 1}${color}

Root: ${alignr}${fs_free /} / ${fs_size /}
${fs_bar 4 /}
SYSTEM: ${alignr}${fs_free /media/SYSTEM} / ${fs_size /media/SYSTEM}
${fs_bar 4 /media/SYSTEM}
SOFT: ${alignr}${fs_free /media/SOFT} / ${fs_size /media/SOFT}
${fs_bar 4 /media/SOFT}
DATA: ${alignr}${fs_free /media/DATA} / ${fs_size /media/DATA}
${fs_bar 4 /media/DATA}
TEMP: ${alignr}${fs_free /media/Temp} / ${fs_size /media/Temp}
${fs_bar 4 /media/Temp}

${color white}NETWORK ${hr 1}${color}

Down ${downspeed eth0} Kb/s ${alignr}Up ${upspeed eth0} Kb/s
${downspeedgraph eth0 25,107} ${alignr}${upspeedgraph eth0 25,107}
Total ${totaldown eth0} ${alignr}Total ${totalup eth0}


配9.04自带的DarkRoom主题太棒了,效果图:


3.7 一些个人小偏好
<1> 把终端加到右键菜单:sudo apt-get install nautilus-open-terminal 安装完relogin
<2> 以root权限打开文件夹:sudo apt-get install nautilus-gksu 安装完relogin, 这样右键单击文件或文件夹,可以选择以管理员打开

未完待续... ...

没有评论:

发表评论