Ubuntu:Gutsy cn

From

Jump to: navigation, search

Image:Ubuntuguide_logo.png


Ubuntu 7.10 (Gutsy Gibbon)

继Ubuntu 7.04(Feisty Fawn)之后,Ubuntu 7.10 (Gutsy Gibbon)于2007年10月18日发布。请加入进来帮助我们测试完善这个指南。

这份手册的英文原作者是马来西亚吉隆坡的Chua Wen Kiat。 目前由拉脱维亚大学(University of Latvia)Linux 中心 维护,任何人都可以参与编辑。

请到官方的 UbuntuGuide.org 论坛 讨论这个指南。

为了防止Wiki遭到蓄意破坏,只有注册用户才能修改这个Wiki和创立新帐号。

如果你有任何新技巧的建议,请到 Talk page 来讨论。

MikrobartOrvilsQuashJiyuu0CargoGabemorrBytecopekrampoSimosStubbyeljacoshaiThunderMHasileadammichaelroachBelisarivsCheatorHankTamalKaotikssoniahKutanMehdirichuxShadymanHavarillfr0zen_penguinLouisShadymanshanlot751EtienneRabid9797Mantas Smelevičiusperspectoffphloseadogsmalugo2debugPakosRedBassCyberAngelCogeeldineroycorreAlgimantasBucinskasUficAntidrugueVahidLouis KingRsinghBorut-TCinglallsTownrayANtuMaLaMpete alleboneGreenstarThe TurkRonBCompotatojoMbrasigma80EnlightenedswineKarthikeyanemorrp1Th0rv4ldjspanglerSevoirForainand other friends of our community edit


Contents


前言

关于 Gutsy

  • Ubuntu 7.10 于2007年10月18日发布。
  • Ubuntu 7.10的代码名是Gutsy Gibbon(勇敢的长臂猿),它是Ubuntu 7.04 Feisty Fawn (易怒的小鹿)的后继版本。
  • 对于桌面和服务器版本,Gutsy将会支持18个月。
  • 如果用户需求更长的支持时间,可以考虑继续使用Ubuntu 6.06 LTS(长期支持版本),其安全支持会直到2011年,而不要更新到或者安装7.10。

如何得知你使用的是哪个版本的Ubuntu

  • 阅读 #概述
  • 在Gutsy中,访问菜单:系统 -> 管理 -> 系统监视器 -> 系统 页

或者,在任何Ubuntu及其衍生版本中,执行下面的命令:

lsb_release -a

Ubuntu的未来版本

  • Ubuntu的发布周期为6个月
  • 基本上在4月份和10月份新版本进行发布
  • 下一个版本计划于2008年的4月24日发布,将会命名为Ubuntu 8.04 (Hardy Heron) (辛劳的苍鹭)。
  • Hardy Heron 将会是长期支持的发布版本,将会在服务器上支持5年,在桌面上支持3年的安全更新。

Ubuntu的早期版本

如果你正在使用一个过时的Ubuntu版本,那么你应该考虑升级到Gutsy。这个版本有很重要的更新,在Gutsy中使用的更新器将会使将来向未来版本迁移更容易。如果你处于生产环境,或者目前所用东西都工作很顺利,你也许希望继续使用一个长期支持(LTS)的版本。

  • Dapper 是最新的长期支持(LTS)版本,下一个长期支持版本将会是Gutsy+1 (Hardy Heron)。

概述

  1. 这是一份Ubuntu 7.10 (Gutsy Gibbon)非官方入门指南。本指南与Ubuntu及Canonical Ltd没有任何关系
  2. 本指南可以ubuntuforums.org的官方论坛上讨论(UbuntuGuide.org 论坛)你现在就可以加入讨论。
  3. 如果你看到浅灰色方框,这意味你必须在终端下运行命令(应用程序-> 附件 -> 终端)或按方框内所提示的内容按其它命令执行。
  4. 为了减少键盘输入错误,请将命令复制后粘贴到终端(在命令上点击鼠标右键-> "复制" or "粘贴"。你也使用"Ctrl+C"复制及"Shift+Insert"粘贴)
  5. "sudo"表示以代替用户执行(SUbstitute User Do)。"sudo"会出现"Password:"的提示,请"Password:"后输入用户密码。举例来说,你可以以系统上别的用户执行命令,如 sudo -u peter <命令> 将以系统上的peter这个用户来执行该命令。
  6. 如果你更深入了解任何命令更多信息,你仅简单通过输入“man”命令去查看帮助页面。例如:"man sudo"将显示"sudo"命令的帮助页面。
  7. 如果你十分厌烦每次都需要键入"apt-get", 请使用新立得软件管理器(Synaptic),这是一个apt-get的图形界面工具。
  8. 使用"apt-get" and "wget"执行安装/更新/下载时,请确保你的计算机连上网络。
  9. 所有引用"aptitude"的地方都将被替换为"apt-get"。你也可以继续使用"aptitude",但是这可能会导致依赖问题。
  10. 下载文件时,在链接上点击鼠标右键->选择 "链接另存为..." -> 确保文件名和扩展名的正确。
  11. 如果你想把UbuntuI翻译成本地语言或在其它方面帮助Ubuntu,请访问https://launchpad.net/
  12. 愿"humanity to others"精神永远与你同在...
如果你使用64位的版本,请将所有的"i386"替换为"amd64"

外部链接声明

这个指南中的文章可能包含外部链接。这能够在保证提供高质量的Howto(如何...)、指令、屏幕截图、视频、指南等等的情况下,让这个指南短一些。但是,Ubuntuguide.org不能对每一个链接的质量进行检查和保证。有时候,有些链接会失效、提供错误信息或者改变他们的内容。所以当你离开Ubuntuguide.org的时候请注意,我们不会对那些链接中的任何信息负责。如果你发现了失效链接或者错误信息的链接,请在这里贴上链接和包含该链接的章节。当然,如果你有时间并且真的很想做一个好人的话,可以帮我们编辑修改这个指南。 谢谢!!

报告无效或者错误信息的链接

如果你发现了失效链接或者错误信息链接,请在这里贴上该链接和发现它的章节。谢谢!


关于 Ubuntu 和官方的衍生版本

Ubuntu 7.10 指南和链接


Ubuntu 屏幕截图

Ubuntu 7.10 屏幕截图展

Kubuntu 7.10 指南和链接

Kubuntu 屏幕截图

Kubuntu 7.10 屏幕截图展

Xubuntu 7.10 指南和链接

Xubuntu 屏幕截图

Xubuntu 7.10 屏幕截图展

Edubuntu 7.10 指南和链接

Edubuntu 官方网站 Wikipedia: Edubuntu

Gobuntu 7.10 指南和链接

Wikipedia: Gobutnu

翻译和本地化

在Ubuntu中对于中文、日文、葡萄牙文和大多数欧洲语言的支持要好于其他的语言。如果你的语言没有足够的支持,那么你可以帮助Ubuntu来翻译它到你喜欢的语言。想要翻译,请访问 https://translations.launchpad.net/ubuntu 然后登陆(如果没有注册的话需要先行注册)。选择你喜欢的语言,然后开始翻译。

更新、升级与安装软件

如何添加额外的源

Work in Progress

菜单操作

将'Feisty'替换为'Gutsy'

  • 选择发布友好的软件源。这些是Ubuntu发布系统的一部分。这是建议的方式。
系统 --> 系统管理 --> 软件源

选中你认为你需要的软件源 (main, universe, restricted, multiverse)。你可能不会需要 'sources'源。

  • 添加第三方软件源。这样的软件源没有被正式监管。有些非常流行,但是,使用这些第三方的源你需要自己承担其风险。
系统 --> 系统管理 --> 软件源 --> 第三方软件 --> 添加

添加你的源的名字。在这个例子中我们将使用 Medibuntu,一个流行的第三方源,而且与Ubuntu没有任何关系。

APT 行: deb http://packages.medibuntu.org/ feisty free non-free
  • 下载所有需要的gpg key文件,并且添加他们到keylist中。这个key将认证这个软件源到你的系统中。Medibuntu源(没有与Ubuntu有任何关系):
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -

手动操作

  • 创建当前源列表的一个备份。
sudo cp -p /etc/apt/sources.list /etc/apt/sources.list_backup
  • 在文本编辑器中打开源列表文件

Ubuntu 用户:

sudo gedit /etc/apt/sources.list
  • 用下面的文本替代其中内容。
要使用你本地的镜像,你可以在archive.ubuntu.com前面添加"cc." (cc = 你的国家代码)
例如: deb http://lv.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ gutsy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy main restricted

## Major bug fix updates produced after the final release of the
## distribution.

deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted

##Universe

deb http://us.archive.ubuntu.com/ubuntu/ gutsy universe
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy universe
deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe

## Multiverse

deb http://us.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse

## Backports

deb http://us.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

## Canonical Partner Repository 

deb http://archive.canonical.com/ubuntu gutsy partner
deb-src http://archive.canonical.com/ubuntu gutsy partner
deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb-src http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse

## PLF REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
deb http://packages.medibuntu.org/ gutsy free non-free
  • 保存编辑好的文件
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -
sudo apt-get update

如何从Feisty升级到Gutsy

如何编辑自动更新

Todo

如何手动更新 Ubuntu

Todo

Add-on Applications

其他应用程序

The application in this section need a home. If Editors have the time, please place these apps in an appropriate category. If the category doesn't exist then make it. Destroy this message when complete. Thanks. --KrazyPenguin 06:16, 27 October 2007 (EEST)

Hotwire - Ubuntu 的图形终端

如果你想要一个Ubuntu的图形终端看一下这个也许会很有用

如何在Ubuntu里安装Epiphany网页浏览器

如果你想知道如何在Ubuntu中安装Epiphany网页浏览器,那么请按照下列步骤操作

apturl - Ubuntu Gutsy Gibbon的一个协议处理器(protocol handler)

如果你想从网页浏览器中安装Ubuntu包,这里有一个很简单的工具

在aMSN中启用拖拽功能

Adobe Reader Gutsy amd64/i386

第一步

echo "deb http://packages.medibuntu.org/ gutsy free non-free" | sudo tee -a /etc/apt/sources.list

第二步

wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

第三步,我们添加插件和Reader

sudo aptitude install acroread acroread-plugins acroread-escript

然后就可以使用Adobe Reader了

OpenOffice 插件

在Ubuntu中的OpenOffice中打开.docx文件。(对于其他发布来说也同样有效)

首先我们需要下载转换器,我们可以在这里找到它 > [1] 下载 "odf-converter-1.0.0-5.i586.rpm"

如果你还没有安装 alien 的话,那么现在安装它,

 sudo apt-get install alien

然后我们需要转换它,我们不想为了这个就要一个 .deb的包,所以我们使用-ct选项,而不是-k。-ct将其转换为.tgz。

 sudo alien -ct odf-converter-1.0.0-5.i586.rpm

一旦它转换完毕,我们需要解压缩:

 tar xvf odf-converter-1.0.0.tgz

现在在你的桌面上将有3个目录(或者是你解压缩的位置里)

现在运行

 sudo cp usr/lib/ooo-2.0/program/OdfConverter /usr/lib/openoffice/program/
 sudo cp usr/lib/ooo-2.0/share/registry/modules/org/openoffice/TypeDetection/Filter/MOOXFilter_cpp.xcu    /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Filter
 sudo cp usr/lib/ooo-2.0/share/registry/modules/org/openoffice/TypeDetection/Types/MOOXTypeDetection.xcu /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Types

然后就好了,你可以打开并且编辑.docx文件了。

Genealogical Research and Analysis Management Program (Gramps)

GRAMPS, the Genealogical Research and Analysis Management Programming System(家谱研究与分析管理程序系统),是一个以Python写成的开源的家谱程序,使用GTK/GNOME作为界面。GRAMPS有导入GEDCOM文件(用于如Windows中的FamilyTree Maker程序)的能力,并且可以生成各种格式的报告,如ABIWord,OpenOffice.org格式,或者HTML和PDF。

sudo apt-get install gramps

桌面

高级桌面特效 (Compiz Fusion)

要启用桌面特效,在这里打开它们:

 系统 > 首选项 > 外观 > 视觉效果

要想自定义选项,安装配置工具:

 sudo apt-get install compizconfig-settings-manager

然后或者在上面的视觉效果中选择"自定义",或者选择:

 系统 > 首选项 -> Advanced Desktop Effects Settings (高级桌面效果设置)

动态系统监控

sudo apt-get install netspeed

右键单击上面的面板,选择"添加到面板..."。添加"系统监视器"(System Monitor)和"网络监视器"(Network Monitor)。右键点击系统监视器,选择首选项。添加你想要监视的资源。

桌面会话记录

是可能包括鼠标指针、声音系统一起录制完整的桌面会话的。这是一个对于屏幕动态捕捉来说非常有用的工具,简单的截屏是无法表达所有事情的。 有三个应用程序可以做这件事情,他们是Istanbul, Wink 和 gtk-recordMyDesktop.

Istanbul
sudo apt-get install istanbul
Wink
sudo apt-get install wink
gtk-recordMyDesktop
sudo apt-get install gtk-recordmydesktop

国际时钟 Gnome Applet (OpenSuse contribution)

要切换到新的国际时钟applet,从这里下载 Here 然后用dpkg来安装。

用右键删除原来的时钟,然后用右键点击空白区域,添加新的applet:

>添加到面板...>Miscellaneous>International Clock>Add

You got it.

添加世界地图,使用它的首选项(Preferences)选择世界的位置。

游戏

Frozen Bubble

要安装 Frozen Bubble 只需要运行:

sudo apt-get install frozen-bubble

或者在 系统 > 系统管理 菜单里使用新立得包管理器,找到它,然后安装即可。

如何解九宫格(Sudoku)游戏

There is a simple Perl script for solving gnome-sudoku. It does not support trial-and-error.

Super Nintendo Emulator (ZSNES) 1.510 for i386/AMD64

For support or questions see http://ubuntuforums.org/showthread.php?t=588744

  • 安装一个第三方的软件源
echo "deb http://packages.dfreer.org gutsy main" | sudo tee -a /etc/apt/sources.list
wget http://packages.dfreer.org/7572013D.gpg -O- | sudo apt-key add -
sudo apt-get update
  • 用下面的命令安装
sudo apt-get install zsnes32 #for amd64 users
sudo apt-get install zsnes   #for everyone else
  • 应用程序 > 游戏 > zsnes or zsnes32

Playstation 模拟器(pSX) 1.13 for i386/AMD64

For support or questions see http://ubuntuforums.org/showthread.php?t=394097

  • 安装一个第三方的软件源
echo "deb http://packages.dfreer.org gutsy main" | sudo tee -a /etc/apt/sources.list
wget http://packages.dfreer.org/7572013D.gpg -O- | sudo apt-key add -
sudo apt-get update
  • 用下面的命令安装
sudo apt-get install psx32 #for amd64 users
sudo apt-get install psx   #for everyone else
  • 应用程序 > 游戏 > pSX or pSX32

KDE 游戏

要安装KDE 3的游戏(推荐Kubuntu的用户),安装kdegames包。

sudo apt-get install kdegames

UrbanTerror 4.0

  • UrbanTerror 4.0 is a Multi-player First Person Shooter. The Game uses the open source quake 3 engine and features many real weapons and free to use servers for multi-player functionality.

More information can be found at UrbanTerror

  • After downloading the script open Terminal into your download directory then make the script executable with the following command:
sudo chmod +x urt40-linux-installer.sh
  • Now double click on the script to execute and follow the directions
  • The install will take awhile as the script executes a download of the necessary files which are about 541MB
  • After the install you will have a nice UrbanTerror icon on your desktop (unless you installed as root)

This easy install script is courtesy of Nexu from the UrbanTerror Forums.

CD/DVD

如何抓取DVD视频

dvd::rip是一个用Perl写的全功能的DVD复制程序。它提供了一个易用但功能丰富的Gtk+图形界面来控制几乎所有抓取和转码处理的方面。他使用广为人知的视频处理瑞士军刀来转码,还用到了许多其它开源工具。

sudo apt-get install dvdrip

如何刻录DVD视频

dvdauthor 是一个可以从合法的mpeg2流生成一个可以在你家里DVD播放器中播放的DVD电影。

sudo aptget install dvdauthor

如何刻录CD/DVD

nautilus-cd-burner是一个基本的、预装的用于刻录CD或者DVD的程序。serpentine是一个预装的音频CD制作程序。nerolinux 是一个 non-free 的 CD/DVD/Blu-Ray/HD-DVD 刻录程序。 k3b 是一个很棒的KDE下的 CD/DVD 刻录工具 (Kubuntu用户的明智的选择)。但是如果你想找一个GTK/Gnome下的替代品,那么可以试试看这些:brasero, cdw/gcdw, gcdmaster, gravemangnomebaker也许会令你产生深刻印象。

dvdisaster 对于由于划盘或者年久的CD或DVD媒体导致的数据丢失提供了额外的安全措施。它可以创建错误修正数据,如果将来盘片损坏后而无法读取某些磁道的话,这些数据将用于恢复数据。

互联网

浏览器插件

Ubuntu 自动安装了浏览网站所需要的Firefox插件。但是如果你想自己安装插件,那么请在终端下运行下列命令:

Java 插件:

sudo apt-get install sun-java6-plugin

Flash 插件:

sudo apt-get install flashplugin-nonfree

或者你想支持开源的 flash 插件:

sudo apt-get install mozilla-plugin-gnash

VLC 插件 (将自动安装 VLC):

sudo apt-get install mozilla-plugin-vlc

MPlayer 插件 (将自动安装 MPlayer):

sudo apt-get install mozilla-mplayer

Real player 插件 (将自动安装 helix-player):

sudo apt-get install mozilla-helix-player

kaffeine 插件 (将自动安装 kaffeine):

sudo apt-get install kaffeine-mozilla

image-zoom 插件 (用于放大或者缩小页面内的图片):

sudo apt-get install mozilla-imagezoom

adblock 插件 (用于阻拦页面中的广告):

sudo apt-get install mozilla-firefox-adblock

Gutsy 包括了通过 Ubuntu 软件源添加Firefox扩展的选项。用于安装这些扩展的选项默认就被安装了。要看或者添加Ubuntu插件的话:

  • 在 Firefox 里,点击工具 > 附加软件
  • 点击 "Get Ubuntu Addons"(取得 Ubuntu 附加软件)
  • 要看所有的可用的插件,点击"Show:"旁边的列表,并且选择"所有可用的应用程序"
  • 选择任何你想要的插件,点击"应用改变"
  • 你可以在Firefox的附加软件窗口中看到你都已经安装了哪些插件。

(注意: 所有的 Ubuntu 插件都可以通过新立得包管理器(Synaptic package manager)取得。)

Shockwave

There is no version of Shockwave for Ubuntu/Linux but WINE can be used to run it. This method will result in 2 Firefox Browsers installed on the computer. Only use the WINE version when using a website that requires it. The native version of Firefox will give better computer performance, so it should used in all other occurrences.

  • Install WINE
  • Download and install Firefox for Windows
  • Download and install Shockwave for Windows

下载管理器 (Downloader for X)

要安装 Downloader for X 只需要运行:

sudo apt-get install d4x

或者在 系统 > 系统管理 菜单里使用新立得包管理器,找到它,然后安装即可。

FTP 客户端 (FileZilla)

FileZilla是一个来自于Windows环境的强大的FTP客户端软件。在它的第三个版本,它实现了跨平台,并且可以在Ubuntu Gutsy软件源中可以得到。

要安装 FileZilla FTP 客户端只需要运行:

 sudo apt-get install filezilla

或者在 系统 > 系统管理 菜单里使用新立得包管理器,找到它,然后安装即可。


如何配置Evolution通过POP/IMAP来使用Gmail处理邮件

Visit http://mail.google.com/mail/ and click settings (should be in top right corner). Select Forwarding and POP/IMAP.

  • If you want to use POP, select either "Enable POP for all mail (even mail that's already been downloaded)" or "Enable POP only for mail that arrives from now on".
  • If you want to use IMAP, select "Enable IMAP".

Save changes.

Open Evolution from Applications -> Internet -> Evolution Mail. If no mail account has been created before, a mail account setup wizard will automatically be opened. Otherwise open it from Edit -> preferences -> Mail Accounts -> Add. Click Forward. Enter your email address for Gmail (including @gmail.com). Click Forward.

  • If you have enabled POP from Gmail set "Server Type" to POP, "Server" to pop.gmail.com, and "Use Secure Connection" to "SSL encryption".
  • If you have enabled IMAP from Gmail, set "Server Type" to IMAP, "Server" to imap.gmail.com, and "Use Secure Connection" to "SSL encryption".

Click Forward. Click Forward. Set "Server" to smtp.gmail.com, and "Use Secure Connection" to "SSL encryption". Click Forward. Click Forward. Click Apply.

Note that IMAP support for GMAIL is being rolled-out currently (Oct. 2007) but is not available to everyone with a GMAIL account yet. So use POP until IMAP is available for every user.

SwiftFox

Swiftfox is the Firefox web browser, but built with optimizations to increase speed on specific CPU types. It is compatible with all Firefox extensions and themes, and uses the same settings location as Firefox, so you can use both transparently.

Instructions from getswiftfox.com

  • Add the Swiftfox repository
 sudo gedit /etc/apt/sources.list
  • Add this line at the bottom
 deb http://getswiftfox.com/builds/debian unstable non-free
  • Update apt sources
 apt-get update
  • Check your CPU compatibility here
  • Install your version of Swiftfox
 apt-get install swiftfox-pentium4
  • Run with
 Programs > Internet > Swiftfox
  • There is also an [installer] available that is distro independent. It is a script that downloads and installs Swiftfox in the /opt directory and attempts to use existing Firefox plugins. The installer is probably the best way for most non-Ubuntu and non-Debian users to install Swiftfox.

Azureus (Java BitTorrent 客户端)

安装Azureus最简单的方法:

sudo apt-get install azureus

但是它需要很多的依赖. 这里讨论一个替换的方法. 另外你可以创建一个 /usr/share/applications/Azureus.desktop文件,文件中包含以下内容,以便让它在主菜单中显示:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Terminal=false
Name=Azureus
Exec=/usr/local/azureus/azureus
Comment=Java BitTorrent client
Categories=Application;Network;
MimeType=application/x-bittorrent;
Icon=/usr/local/azureus/Azureus.png

(这里假定azureus是安装在 /usr/local 目录下)

多媒体播放器

如何安装带多媒体解码器的Mplayer

Simple guide for mplayer and codecs

  • Download SMPlayer (a great front-end for MPlayer) from here and double click to install it. The smplayer front-end is also available to install through synaptic package manager.
在64位系统上让Mplayer能够支持wmv9格式

Playing wmv9 files on AMD64 doesn't exactly work out of the box. To get it working, you will have to install the 32bit version of mplayer, along with all the necessary codecs. On my relatively new install of Gutsy, I didn't need to install any library files, which made getting it to work that much easier. That being said, follow these steps and you should be watching wmv9 files in no time.

Download the version of mplayer32 for Edgy (it works fine) and place into temporary directory

mkdir mplayer32temp
cd mplayer32temp
wget http://folk.ntnu.no/grannas/debs/mplayer32_20070130-1_amd64.deb

Extract the package you just downloaded, and install to the proper locations (hit 'n' when it asks to replace a file)

sudo dpkg -x mplayer32_20070130-1_amd64.deb ./
sudo mv -i usr/bin/* /usr/bin/
sudo mv -i usr/lib32/* /usr/lib32/

Get the latest win32 codecs from mplayerhq (link is current as of Nov 04, 2007), extract and install (again, hit 'n' when it asks to replace a file)

wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar jxfv essential-20071007.tar.bz2
sudo mv -i essential-20071007/* /usr/lib/win32/

play a wmv9 file and enjoy.

mplayer32 foobar.wmv

如何安装amaroK多媒体播放器

  • Note: Amarok is already installed if you are using KDE.
sudo apt-get install amarok
  • Run from menu:
Applications -> Sound & Video -> amaroK
如何卸载amaroK
sudo apt-get remove amarok


How to get Mouse over preview of MP3 files working

sudo apt-get install mpg321
sudo apt-get install ubuntu-restricted-extras
sudo apt-get install pulseaudio
sudo apt-get install pulseaudio-esound-compat
sudo apt-get install libasound2-plugins

如何安装VLC媒体播放器

sudo apt-get install vlc
如何卸载VLC媒体播放器
sudo apt-get uninstall vlc

如何安装Banshee音乐管理器和播放器

sudo apt-get install banshee
如何卸载Banshee
sudo apt-get remove banshee

如何编码/解码音频

There is a great command line tool, sox which not just a ordinary encoder/decoder but a good composer. Read its manual for more information.

Input(s) → Balancing → Combiner → Effects → Output

sudo apt-get install sox

sox cannot handle Real Audio format. For that you need mplayer which converts a .rm file to a .wav file and then use sox to convert wave file to other file.

 mplayer -ao pcm:file=output.wav input.rm

如何编码/解码视频

mencoder, avidemux, transcode, ffmpeg2theora, etc. are some video converting tools. Read their manuals for information.

sudo apt-get install mencoder avidemux transcode ffmpeg2theora

如何编辑视频

sudo apt-get install ubuntustudio-video

Text-to-Speech

Visit https://help.ubuntu.com/community/TextToSpeech

编程 / 网页开发

Quanta Plus

(Quanta is a KDE application, but also works on GNOME.) To install Quanta, HTML/XML/PHP/Etc Web Creation Software:

sudo apt-get install quanta kompare kxsldbg cervisia
Applications > Programming > Quanta Plus

Netbeans IDE

Netbeans is a platform independent IDE for Java. But it also supports C/C++, Ruby, portals and lots of other stuffs as plug-ins. At the point of writing, version 5.5.1 is the latest stable release and can be installed by:

sudo apt-get install netbeans5.5

Alternately you can download Netbeans 6.0 beta 2 and install it manually. The size of the installation package varies from 11 MB to 200 MB.

Netbeans with Web & Java EE pack

If you want to use NetBeans for web development and want to integrate with Java EE, download the "Netbeans with Web & Java EE" pack. The plug-in mechanism of installing additional modules are not recommended as it installs it on user directory (~/.netbeans/6.0beta2/modules/) rather than system-wide installation directory (/usr/local/netbeans-6.0beta2/nb6.0/modules/).

Netbeans with Web & Java EE pack comes with 2 built in runtime environments:

  • GlassFish V2 Build 58g
  • Apache Tomcat 6.0.14

Those are ideal for both development and production use. Thus you do not have to install either Sun Java Application Server of Apache Tomcat separately. Also uninstalling Netbeans will not uninstall them. You have to uninstall them separately.

But in case you want to install the servers separately, you typically have to run Netbeans as root. Alternately, you can also change the configuration files' owner/group and permissions of Tomcat and GlassFish to work with Netbeans.

实用程序

压缩工具

Zip, Gzip and Bzip2 are the most popular compression tools available in almost every every Linux. But of late two new compression tools available: p7zip (http://7-zip.org/), ace and rar (http://www.rarlab.com/). 7-zip is a open-source project, but rar and ace are not.

sudo apt-get install rar unrar
sudo apt-get install p7zip-full
sudo apt-get install unace

Ark is the compression tool for kde, and has support for more formats including rar.

sudo apt-get install ark

剪贴板管理器 (Glipper)

To install Glipper simply run:

sudo apt-get install glipper

or use Synaptic Package Manager under System > Administration menu, to locate and install the omonymous package.

密码管理器 (KeePassX)

KeePass is a crossplatform password manager. To install it simply run:

sudo apt-get install keepassx

or use Synaptic Package Manager under System > Administration menu, to locate and install the omonymous package.

如何在nautilus中修复/集成蓝牙

On Some systems bluetooth "Browse Device" fuction doesn't work properly.

To Fix This:

sudo apt-get install gnome-vfs-obexftp

or

sudo aptitude install gnome-vfs-obexftp

如何安装Google Earth (世界地图程序)

Google earth is a world map viewer. It can show 3D buildings and bridges in 3D view. It shows satellite pictures by default. The latest version also includes sky viewer. See http://earth.google.com/ for more details.

Google Earth is available in the Medibuntu Package archive.

First add Medibuntu to your package list

echo "deb http://packages.medibuntu.org/ gutsy free non-free" | sudo tee -a /etc/apt/sources.list

Second add the PGP key of Medibuntu to you keyring

wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

Third install Google Earth

sudo aptitude install googleearth


Alternatively you can install Google Earth directly from the Google installer:


Download Google Earth in to Your Desktop. Open terminal and run:

chmod +x Desktop/GoogleEarthLinux.bin
sudo Desktop/GoogleEarthLinux.bin

Follow the instructions to complete the instructions.

如何安装Picasa (来自于Google的照片管理器)

Picasa is software that helps you instantly find, edit and share all the pictures on your computer. Picasa makes advanced editing simple by putting one-click fixes and powerful effects at your fingertips. And Picasa makes it a snap to share your pictures – you can email, print photos home, and even post pictures on your own blog. You can install it in four ways:

sudo apt-get install picasa
  • Download the Self-extracting installer and follow the instruction set for Google Earth.
  • Install the Windows version (with the help of WINE).

如何安装Google Desktop (搜索程序)

Google Desktop is a desktop search application that gives you easy access to information on your computer and from the web. Desktop makes searching your own email, files, music, photos, and more as easy as searching the web with Google. You can download Google Desktop in two ways:

sudo apt-get install google-desktop-linux

如何安装ntop (网络监视工具)

Ntop is a network monitoring utility. You can monitor local devices as well as devices with Netflow output (like a Cisco router). It's very easy to install too, open a terminal and type:

sudo apt-get install ntop

Now that it is installed, you have to do some basic setup. Once again, in the terminal, type:

sudo ntop

You will be asked for a password, and then to confirm the password. This will be the admin password for the ntop web interface. Now, again in the terminal type:

sudo /etc/init.d/ntop start

Thats it! ntop is running! Try browsing to http://127.0.0.1:3000 to get started. Visit http://www.ntop.org/ for more information.


如何安装宗教文字学习应用程序

如何安装Gnomesword (圣经学习程序)
sudo apt-get install gnomesword sword-language-pack-en sword-text-web
  • If you require other languages type:
sudo apt-cache search bible
  • Take a look at the sword-language-pack's and the sword-text's for additional languages and install as needed.

Gnomesword is found under Applications-->Accessories.

  • Under KDE, use kio-sword instead of Gnomesword:
sudo apt-get install kio-sword
How to install a Quran researching tool (Zekr)

Zekr is an open platform Quran study tool for simply browsing and researching on the Quran.

sudo wget http://siahe.com/zekr/apt/sources.list.d/gutsy.list -O /etc/apt/sources.list.d/zekr.list                                                                        
wget -q http://siahe.com/zekr/apt/zekr.debian.gpg -O- | sudo apt-key add -                                                                                                 
sudo apt-get update                                                                                                                                                        
sudo apt-get install zekr ttf-me-quran ttf-sil-scheherazade
sudo apt-get install ttf-farsiweb flashplugin-nonfree
  • Zekr comes with extra Quran translations in Persian, Urdu, French, Russian, English, Turkish, Bosnian, Dutch packaged as zekr-quran-translations-XY where XY is the ISO code of the language. Run
apt-cache search zekr-quran-translations

in a shell to list them all. Then among the result list choose the appropriate package and install it: For example if you want to install English Quran Translations run the following command:

sudo apt-get install zekr-quran-translations-en

如何安装教育应用软件

如何安装 Mnemosyne

Mnemosyne is a sophisticated free flash-card tool which optimizes your learning process. To install the latest version in the repositories run the following command

sudo apt-get install mnemosyne

or use Synaptic Package Manager under System => Administration menu, to locate and install the mnemosyne package.

To install the latest version (the one in the repository is somewhat out of date) first install the dependencies:

sudo apt-get install python python-pygame python-qt3 python-support python-xml

then download the latest source package mnemosyne-0.9.10.tgz:

wget http://superb-east.dl.sourceforge.net/sourceforge/mnemosyne-proj/mnemosyne-0.9.10.tgz

Decompress it:

tar -xzf mnemosyne-0.9.10.tgz

go to the directory

cd mnemosyne-0.9.10/

run this command to install it:

sudo python setup.py install

To create a launcher for it in your Applications Menu:

System => Preferences => Main Menu => Education (or wherever) => New Item:
Name: Mnemosyne
Command: mnemosyne

安全

如何恢复用户密码

sudo apt-get install john
sudo john /etc/shadow

如何重置root密码

在安全模式下重启Ubuntu,并输入:

passwd

即可修改root帐户密码.

如何创建或修改GRUB菜单密码

Visit here.

如果忘记了GRUB密码,如何修改root密码

请参考 这里. 为了防止此类事情,你需要设置一个BIOS密码,并设置硬盘为第一启动设备。

服务器

iTunes兼容的媒体服务器

If you want iTunes-compatible Media server in Ubuntu try this

PostgreSQL

Postgresql is a well supported and open source database server. There is a long debate regarding whether MySQL is better or PostgreSQL. Actually, there are similar debates like it: Gnome vs KDE, Perl vs Python, PHP vs JSP, Java vs .Net (or Mono). But from installation point of view, it has been seen that PostgreSQL is lighter and requires less dependency than MySQL.

To Install PostgreSQL (both client and server):

sudo apt-get install postgresql-8.2

To install PostgreSQL documentation:

sudo apt-get install postgresql-doc-8.2

To install JDBC3 driver for PostgreSQL:

sudo apt-get install libpg-java

To enable php support for PostgreSQL:

sudo apt-get install php5-pgsql

To use postgresql, create a database instance and a user/role:

sudo -u postgres createdb $USER
sudo -u postgres createuser $USER

Making both database instance and user/role as your login ID lets you to start PostgreSQL client very easily:

psql

To be able to login from remote machine or from PHP or through JDBC driver, you have to set your password from PostgreSQL client (psql):

ALTER USER user PASSWORD 'pass';

replace user and pass by your user name and password respectively. To test whether remote login works or not, run:

psql -h host -p 5432 -d database -U user

Visit http://www.php.net/manual/en/ref.pgsql.php to see how php works with PostgreSQL.

与 OpenOffice 一同使用

  • Open Applications -> Office -> OpenOffice.org Database.
  • Select 'Connect to an existing database'. From the list select JDBC and click Next.
  • Make Datasource URL to:
jdbc:postgresql://localhost/database

Replace localhost by your hostname, database by the database instance you have created.

  • Set JDBC driver class to:
org.postgresql.Driver
  • Click 'Test class' to make sure JDBC driver class connects Datasource URL properly. Click Next.
  • Type your User name and select 'Password required' option.
  • Click Test connection. A popup dialog will appear. Enter your password and click OK.
  • If everything works properly, then a confirmation dialog will appear.
  • Click Next. Some optional settings will appear. Click Finish to complete.

使用JDBC驱动

The following Java code is a simple program to illustrate how JDBC can be used with Postgresql:

// pgVersion.java

import java.sql.*;

class pgVersion {
 public static void main(String arg[]) throws Exception {
  if(arg.length!=4) {
   System.out.println("usage: java pgVersion host database user password");
   return;
  }
  // Class.forName("org.postgresql.Driver");
  Driver driver=new org.postgresql.Driver();
  DriverManager.registerDriver(driver);
  String url="jdbc:postgresql://"+arg[0]+"/"+arg[1]+"?user="+arg[2]+"&password="+arg[3];
  Connection conn=DriverManager.getConnection(url);
  Statement stat=conn.createStatement();
  ResultSet rs=stat.executeQuery("SELECT version()");
  rs.next();
  System.out.println(rs.getString("version"));
  rs.close();
  stat.close();
  conn.close();
  DriverManager.deregisterDriver(driver);
 }
}

You can run the former code in two ways:

  • Using CLASSPATH environment variable:
export CLASSPATH=/usr/share/java/postgresql.jar:.
javac pgVersion.java
java pgVersion host database user password

Here host, database, user and password should be substituted according to your configuration. To make $CLASSPATH permanent, you have to save the command in either /etc/bash.bashrc or ~/.bashrc.

  • Alternately, you can run as follows:
javac -classpath /usr/share/java/postgresql.jar pgVersion.java
java -classpath /usr/share/java/postgresql.jar:. pgVersion host database user password

The output is as expected:

PostgreSQL 8.2.5 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.1.3 20070831 (prerelease) (Ubuntu 4.1.2-16ubuntu1)

SSH

如何安装 SSH 服务以提供远程管理服务

sudo apt-get install ssh

如何使用 SSH 链接到远程Ubuntu主机

The Ubuntu host must be running the SSH Server. Read #How to install SSH Server for remote administration service.

In this example:

Remote Ubuntu machine: 192.168.0.2 username is a valid user on the remote host

ssh username@192.168.0.2

You can tunnel to a URL as well:

ssh username@foobar.dyndns.org

If your LAN uses a dynamic IP to connect to the Internet, you can use a Dynamic IP service (such as DynDNS) to assign a static URL to your LAN (foobar.dyndns.org, for example). An SSH request over the Internet to your URL (e.g. foobar.dyndns.org) would then be routed by the DynDNS service to your modem/router. Your router must then be set to forward the port used for the SSH tunnel to your host machine on the LAN. (SSH tunnels generally occur by default over port 22, but it can be changed (see below)).

For some humor: Read Etymology of foobar. You can explicitly select the port number (instead of port 22) for the SSH tunnel:

ssh username@foobar.dyndns.org:11022

However, if you do this, the host SSH server must be listening on the same port (port 11022 in the example). The port to listen to can be set in the ssdh_config file of the OpenSSH server (provided in Ubuntu) on your host. Also, your router must be configured to forward port 11022 to your OpenSSH host.

如何改变SSH服务器端口号

Open /etc/ssh/sshd_config for editing

gksu gedit /etc/ssh/sshd_config

Look for the line

# What ports, IPs and protocols we listen for
Port 22

Change 22 to the value you want, then save and restart the SSH server

sudo /etc/init.d/ssh restart

使用SSH来进行端口转发

ssh -L <local port>:<remote computer>:<remote port> <user>@<remote ip>

An example is:

ssh -L 6669:94.92.10.15:6667 foowho

In this example, local port 6669 on the local client computer is tunneled by encrypted SSH over the default port 22 to the router at 94.92.10.15. The router must be set up to forward port 22 to whatever the internal LAN IP (such as 192.168.0.56) of the SSH host is. The host is running OpenSSH (ssdh service) and is set to listen to port 22. It then routes the incoming data to the host port 6667, where presumably some other program is waiting for data. foowho has an account on the host running the OpenSSH server.

SSH tunnels can also be established using URLs and even alternate ports. An example is:

ssh -L 5900:foobar.dyndns.org:5900 foowho -p 11022

In this example, local port 5900 on the client is forwarded through an SSH tunnel on port 11022 to foobar.dyndns.org. The DNS service translates foobar.dyndns.org into the appropriate WAN (Internet) IP address, where the router is listening. The router is set up to forward port 11022 to the LAN machine hosting the OpenSSH server, which is listening on port 11022. It then sends the data to whatever program is running on port 5900 on the host.

  • You can forward a local port to a different port on the remote host.
Example: Make port 80 (web server/browser) on the remote host at 10.0.2.10 available locally as port 81
ssh -L 81:10.0.2.10:80 user@office.net
  • You can create secure SSH tunnels to multiple hosts using multiple ports.
ssh -L 81:10.0.2.10:80 -L 82:10.0.2.20:80 -L 83:10.0.2.30:80 user@office.net

Now, local port 81 locally forwards to port 80 on the host at 10.0.2.10, local port 82 forwards to port 80 on the host at 10.0.2.20 and local port 83 forwards to port 80 on the host at 10.0.2.30. In this example, user has an account on all three host machines at 10.0.2.10, 10.0.2.20, and 10.0.2.30.

  • Once port forwarding is set up by ssh, an application is directed to the SSH tunnel for port usage by using the loopback as the destination.
Example 1:
ssh -L 81:10.0.2.10:80 user@office.net
http://localhost:81 or http://127.0.0.1/:81

will direct a web browser to use port 81 locally, which is being redirected by SSH to port 80 on the remote host at 10.0.2.10.

Example 2:
ssh -L 5900:foobar.dyndns.org:5900 foowho
vncviewer 127.0.0.1 or vncviewer localhost

will direct vncviewer (which uses port 5900 by default) to direct its traffic through the ssh tunnel to the host at foobar.dyndns.org, where, presumably, a VNC server is listening on port 5900.

Ubuntu 7.10 LAMP Server

If you are looking for simple LAMP Server setup in 15min including webmin installation this is for you

(This requires the server version of Gutsy Gibbon, not the standard desktop edition)

如何安装 Webmin

Webmin is an browser-based administration tool for Apache, PHP, MySQL, and Much More.

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.370_all.deb

sudo apt-get install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl libmd5-perl

sudo passwd root (Enter new root password, retype)

sudo dpkg -i webmin_1.370_all.deb

To use webmin, type the following in a browser: (Make sure to use HTTPS not HTTP)

Sun Java Application Server (Java EE)

安装

Sun Java Application Server is the heart of Java EE. Download either of the following versions:

  • Java EE 5 SDK Update 3
  • Java Application Platform SDK Update 3 Beta
  • Sun Java System Application Server 9.1 (under individual download section)

Alternately you can download GlassFish application server (community maintained):

Make the download file executable and run as root by:

chmod +x Desktop/filename
sudo ./Desktop/filename

Lets assume $JAVAEE_HOME indicates the installation directory. Now, either add $JAVAEE_HOME/bin in your PATH or make a link of asadmin in your path by

sudo ln -s $JAVAEE_HOME/bin/asadmin /usr/local/bin/asadmin

The command 'asadmin' is the main and most important command for Java Application server.

配置

When Java EE installs, a domain 'domain1' is automatically installed with it in $JAVAEE_HOME/domains/ which is the default directory for all domains. Generally this directory ($JAVAEE_HOME/domains/) is not writable. So, as a unprivileged user you can create your own domain in your home directory.

To create, start, stop and delete a domain in your home directory:

asadmin create-domain --adminport 4848 --user user --profile developer --domaindir ~ mydomain
asadmin start-domain --domaindir ~ mydomain
asadmin stop-domain --domaindir ~ mydomain
asadmin delete-domain --domaindir ~ mydomain

Alternately you can make $JAVAEE_HOME/domains/ writable to do domain-related works from default domain directory. E.g.

sudo chmod +w $JAVAEE_HOME/domains/
asadmin create-domain --adminport 4848 --user user --profile developer mydomain
asadmin start-domain mydomain
asadmin stop-domain mydomain
asadmin delete-domain mydomain

If you have only one domain in the default domains directory ($JAVAEE_HOME/domains/) then you do not have to give the domain name to start or stop a domain. E.g.

asadmin start-domain
asadmin stop-domain

Tomcat 6

如何安装 tomcat

Tomcat can be found in universe repository but it has some drawbacks (e.g. lots of dependencies, unavailability of version 6.x, do not use Sun Java). Thus manual installation is recommanded.

Download latest stable version of tomcat from here and extract it in /usr/local as root. Add "JAVA_HOME=/usr/lib/jvm/java-6-sun/" to bin/setclasspath.sh. Make sure that sun-java6-jre is installed. Make a soft-link of bin/catalina.sh as /usr/local/bin/tomcat to access easily. Optionally you can remove .exe and .bat files and edit .sh files to remove cygwin, os400 and darwin related codes.

如何与NetBeans使用tomcat

You have to make the configuration files readable because Netbeans generally do not run with administrative privilege. To use Tomcat with with NetBeans, you have to set a user with manager role. A typcal $CATALINA_HOME/conf/tomcat-users.xml file would look like:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="admin"/>
  <role rolename="manager"/>
  <role rolename="tomcat"/>
  <user username="admin" password="admin" roles="admin"/>
  <user username="manager" password="manager" roles="manager"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
</tomcat-users>

You can also use tomcat that comes with NetBeans web & Java EE pack.

How to use tomcat with PostgreSQL

A database connection pool creates and manages a pool of connections to a database. Recycling and reusing already existing connections to a dB is more efficient than opening a new connection. It is still possible and valid to open and close connection for each servlet/jsp (visit #Using_JDBC_driver for details).

Before proceeding, let's assume that you $CATALINA_HOME denotes tomcat installation directory (typically: /usr/local/apache-tomcat-6.0.14).

echo $CATALINA_HOME
sudo ln -s /usr/share/java/postgresql.jar $CATALINA_HOME/lib/postgresql.jar
sudo mkdir $CATALINA_HOME/webapps/dataSourceTest
sudo chown $USER:$USER $CATALINA_HOME/webapps/dataSourceTest
cd $CATALINA_HOME/webapps/dataSourceTest
mkdir META-INF WEB-INF WEB-INF/classes

Create WEB-INF/web.xml and set its content:

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 version="2.5">

 <resource-ref>
   <description>PostgreSQL connectivity</description>
   <res-ref-name>jdbc/postgresql</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
 </resource-ref>

 <description>
   Tamal's page for testing
 </description>
 <display-name>Testing page</display-name>
 <servlet>
   <servlet-name>pgsqlVersion</servlet-name>
   <servlet-class>pgsqlVersion</servlet-class>
 </servlet>
 <servlet-mapping>
   <servlet-name>pgsqlVersion</servlet-name>
   <url-pattern>/pgsqlVersion</url-pattern>
 </servlet-mapping>
</web-app>

Create META-INF/context.xml and set its content (replace hostname, database instance name, user id and password):

<?xml version="1.0" encoding="UTF-8"?>
<Context>
 <Resource
   name="jdbc/postgresql"
   auth="Container"
   type="javax.sql.DataSource"
   driverClassName="org.postgresql.Driver"
   url="jdbc:postgresql://host/database"
   username="user"
   password="password"
   maxActive="20"
   maxIdle="10"
   maxWait="-1"/>
 <WatchedResource>WEB-INF/web.xml</WatchedResource>
 <WatchedResource>META-INF/context.xml</WatchedResource>
</Context>

Create pgsqlVersion.java and set its content:

import java.io.*;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
import javax.servlet.*;
public class pgsqlVersion extends GenericServlet {
 public void service(ServletRequest request, ServletResponse response) {
  try {
  response.setContentType("text/html");
  PrintWriter pw=response.getWriter();
  Context initContext = new InitialContext();
  Context envContext  = (Context)initContext.lookup("java:/comp/env");
  DataSource ds = (DataSource)envContext.lookup("jdbc/postgresql");
  Connection conn = ds.getConnection();
  Statement stat=conn.createStatement();
  ResultSet rs=stat.executeQuery("SELECT version()");
  rs.next();
  pw.println(rs.getString("version"));
  rs.close();
  stat.close();
  } catch(Exception e) { }
 }
}

Create index.html and set its content:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>PostgreSQL datasource</title>
</head>
<frameset rows="80%, 20%">
  <frame src="pgsqlVersion.java">
  <frame src="pgsqlVersion">
</frameset>
</html>

Then compile the servlet:

export CLASSPATH=$CATALINA_HOME/lib/postgresql.jar:$CATALINA_HOME/lib/servlet-api.jar:.
javac -d WEB-INF/classes/ pgsqlVersion.java

Finally, visit http: //host:8080/dataSourceTest. Thats all!

Nagios Network Monitoring Server

It should be noted that this howto instructs you to build nagios from its sources, while it exists on the official repositories.

NFS 服务器

  • Read Linux NFS FAQ
  • Run this command for each computer to determine the IP Addresses for each one:
ifconfig

安装 NFS 服务器

sudo apt-get install nfs-kernel-server nfs-common portmap

Reconfigure Portmap to not bind to loopback interface:

sudo dpkg-reconfigure portmap 
sudo /etc/init.d/portmap restart

Define which folders to share (export):

sudo nano /etc/exports

Add share (export) definitions:

This will export path to all IP addresses between 192.168.1.1 and 192.168.1.254 with Read/Write access:

/path/to/shared/files 192.168.1.0/24(rw,no_root_squash,async)

This will export path to all IP addresses between 192.168.1.1 and 192.168.1.254 with Read Only access:

/path/to/shared/files 192.168.1.0/24(ro,async)

192.168.1.0/24 above would be the clients IP Address

When finished, save changes and restart the NFS Server:

sudo /etc/init.d/nfs-kernel-server restart

Export your new configuration:

sudo exportfs -a

安装 NFS 客户端

sudo apt-get install portmap nfs-common

手动绑定

cd ~
mkdir temp
sudo mount 192.168.1.1:/path/to/shared/files temp

192.168.1.1 above would be the Servers IP Address

You may need to restart NFS services:

sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart

自动绑定

Create mountpoint:

sudo mkdir /mnt/files

Edit configuration:

gksudo gedit /etc/fstab

Add something similar to below:

192.168.1.1:/path/to/shared/files /mnt/files nfs rsize=8192,wsize=8192,timeo=14,intr 0 0

Test new configuration:

sudo mount -a

Reboot to test automatic mounting.

硬件

NVidia 驱动

First, determine what kernel you have running:

user@localhost:~$ uname -a
Linux localhost 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux

I have the generic kernel, so I need to install the following:

sudo apt-get install linux-restricted-modules-generic


After that's done, go to System > Administration > Restricted Drivers Manager and turn on the driver.

Some users may receive an error screen: "The software source for the packsge nvidia-glx-new is not enabled." This can be overcome by going to System > Administration > Software Sources and ticking all the boxes under the heading "Downloadable from the Internet", click close and then allow Ubuntu to reload the package lists. The NVidia drivers can then be enabled using the method above.

You can optionally prevent showing NVidia logo on startup by:

sudo nvidia-xconfig --no-logo

Wacom tablet

By default, options for the Wacom tablet are commented out. Type the following command to edit the xorg.conf file.

gksu gedit /etc/X11/xorg.conf

Uncomment the following by removing the "#" or just replace the tree lines:

InputDevice     "stylus"	"SendCoreEvents"
InputDevice     "cursor"	"SendCoreEvents"
InputDevice     "eraser"	"SendCoreEvents"

Save and restart your X-session by typing CTRL-ALT-BACKSPACE.

Microsoft Intellimouse

To get the scroll wheel and side buttons to be recognized, change your /etc/X11/xorg.conf mouse section to look like the following:

Section "InputDevice"
  Identifier  "Configured Mouse"
  Driver    "mouse"
  Option    "CorePointer"
  Option    "Device"  "/dev/input/mice"
  Option    "Protocol"  "ExplorerPS/2"
  Option    "Buttons"   "9"
  Option    "ZAxisMapping"  "4 5"
  Option    "Emulate3Buttons" "true"
EndSection

The ZAxisMapping maps the scroll wheel. Setting Buttons to 9 makes the side buttons recognized. You can test in a terminal with xev.

Disable CAPS LOCK

I like to remap mine to <Ctrl>. Just run gnome-keyboard-properties with "System > Preferences > Keyboard", click on the "Layout Options" tab and then on the arrow next to "Ctrl key position". Selecting "Make CapsLock an additional Ctrl" does the trick.

在启动时启用数字键盘锁定(NUM LOCK)

数字键盘锁定键的开机默认状态是关着的;如果你的键盘上有数字小键盘,用它来输入数字要快得多。以下步骤可以将数字键盘的开机状态设定为“开”的状态:

  • 启动 Synaptic,下载、安装 "numlockx";或者你也可以用下面这个命令行:
  sudo apt-get install numlockx
  • 这个软件安装完毕之后,你还得编辑一下相应的启动文件。首先,你应该把这个文件做一个备份:
  sudo cp /etc/gdm/Init/Default /etc/gdm/Init/Default.bak
  • 下一步,用这条命令修改 gdm/Init 文件:
  gksudo gedit /etc/gdm/Init/Default
  • 将编辑页面翻到文件末尾,在 "exit 0" 这一行的上面加入以下这些行:
  if [ -x /usr/bin/numlockx ]; then
  /usr/bin/numlockx on 
  fi
  • 下次你开机的时候,你键盘上的数字小键盘锁定键(NUM LOCK)就会自动处于“开”的状态。

Citrix ICA 客户端

The Citrix client no longer suffers from any of the previous Ubuntu version's problems of UTF8 font issues, OpenMotif depends, or flaky/broken browser integration. It just works!

  • Download the latest en.linuxx86.tar.gz (currently v10.6) from Citrix.com and save to your desktop
  • Right-click tar.gz file, and Extract Here
  • Open a Terminal
 Programs > Accessories > Terminal
  • Change to the directory where we extracted the client
 cd Desktop/en.linuxx86
  • Run the setup program
 ./setupwfc
  • Select the defaults

Now, web files from Metaframe Presentation Server, Citrix Access Gateway, etc webpages will work fine in Firefox.

Someone may wish to add an entry on how to use the client to connect to a local Citrix farm.

WINE

Latest install instructions are always at: WineHQ.org

Add repository key:

 wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -

Add repository to apt sources:

 sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/gutsy.list -O /etc/apt/sources.list.d/winehq.list

Update apt sources:

 sudo apt-get update

Install WINE:

 sudo apt-get install wine

The program menu then appears in Programs under Wine, or double-click a Windows/DOS .exe file.

为 Wine 安装 Internet Explorer 6

IE 6 is not recommended for general usage, but some Windows packages (installed under Wine) require IE6 to complete installation. Furthermore, IE 6 is useful for checking code for developers who want to see how their web pages appear under IE 6.

Install the required package cabextract from Synaptic Package Manager (or from apt-get install cabextract).

Download and run the IEs4Linux installation script from the IEs4Linux website:

     wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
     tar zxvf ies4linux-latest.tar.gz
     cd ies4linux-*
     ./ies4linux


There is a beta version of the install at http://www.tatanka.com.br/ies4linux/downloads

If you hit advance you have the option to install IE7. I have not gotten it to work as of yet, but IE6 installs with no issues on amd64 and i386

Accept all the defaults for installation.

VMWare 服务器

Until the Commercial Ubuntu repository includes the VMWare Server, you can use the following 'How To' to compile from source.

http://ubuntu-tutorials.com/2007/09/26/how-to-install-vmware-server-on-ubuntu-710/

To be able to use usb devices look at following bug comment at https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/156085/comments/5


如何安装 Broadcom 无线驱动

  • This worked for me Kubuntu 7.10 32 bit but there are several ways
  • First, make sure you have the appropriate hardware
lspci | grep Broadcom
  • Output should match this
02:03.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 02)
  • Then you have to add a repository
gsku gedit /etc/apt/sources.list
  • Add
http://ubuntu.cafuego.net/dists/feisty-cafuego/bcm43xx/
  • Back in the console
sudo apt-get install bcm43xx-firmware 
  • Just press yes, let it install, and reboot! Thanks to Pete and the 7.04 guide for this.

需求

If you have requests that you would like to be part of this guide, put them here.

  • How to disable insert key on keyboard
  • How to enable ripping a CD to MP3 using Sound Juicer
  • Individual installation guides for Apache2+PHP5, MySQL and #PostgreSQL (and first administrative tasks like changing admin password and creating a first user)
  • How to install SSH server and specify its port number and settings
  • How to change console resolution.
  • How to fix a broken gutsy after a crash.
  • How to install and use winmodem (Si3054 modem alsa captur device - notebook asus F3JM ) with efax for example
  • how to install fingerprint reader in a laptop lenovo, model 3000 n100 0768-fvg
  • How to open files as root user via right click
  • How to install MS core fonts and enable sub-pixel smoothing
  • A detailed wiki on how to install backuppc
  • How to install and configure Spamassassin
  • Install and configure Bluetooth Headsets
  • How to set the resolution of the login screen
  • How to install Nintendo 64 Emulers
  • How to install Wireless card drivers.
  • How to enable Compiz-fusion in Gutsy for Intel i810.
  • X11 Forwarding to a Windows machine
  • DVD and CD burning and ripping - data, music and ISO images
  • How to install and configure OSX-like dock (Kooldock vs. Kiba vs AWN etc.)
  • Please fill in requests here.

排障

Place solutions to problems you have encountered with Gutsy here. They may be workarounds to bugs or other solutions to other problems.

OpenOffice 拼写检查问题

This problem is not a bug at all. Some Languages do not have spell checking support while others do. For example, "English (India)" do not support spell checking but "English (USA)" do. Just goto

Tools -> Options -> Language Settings -> Languages

and select a Western language that have a check mark beside the language name. Thats it.

If you want to add languages that supports spell checking, just install the package myspell-<language> where <language> is the desired language i.e:

apt-get install myspell-fr 

to install the french dictionnary.

SCIM输入法问题

SCIM 在Gutsy Gibbon下可能不能正常工作,虽然在Feisty Fawn下工作正常。直到问题被修复,你可以使用其他方法来切换键盘布局。

  • 系统 -> 系统管理 -> 语言支持,选择你想要使用的语言(如中文)。
  • 打开菜单 系统 -> 首选项 -> 键盘,添加你想要使用的布局。
  • 右键单击上面面板的空白部分,选择"添加到面板...",添加键盘指示器。

修复缓慢的启动/错误的splash屏幕

if your system is booting slowly or your ubuntu splash screen is not being displayed it could be that Usplash has created the s[plash screen incorrectly

1) edit /boot/grub/menu.lst

 sudo gedit /boot/grub/menu.lst

At the very end of the kernel line after "splash" , add

 "vga=***" 

replace *** with the code from the table below that corresponds with the resolution and colour setting you are using

Screen 640x480 800x600 1024x768 1280x1024 1600x1200
Colors
256 769 771 773 775 796
32,768 784 787 790 793 797
65,536 785 788 791 794 798
16.8M 786 789 792 795 799

the line should look something like this

 kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=20fd9912-6383-4860-9cd8-88a11909d715 ro quiet splash vga=791

Save that file, close it,

2) edit /etc/usplash.conf

    sudo gedit /etc/usplash.conf

change the resolution to the one you set in the previous step save and close

3) rebuild the bootsplash screen

 get your kernel version
   uname -r
     This lists your current kernel version.
   sudo update-initramfs -u -k <insert results from uname -r here>
 This rebuilds the image that Grub uses to start the system.

4) reboot


注销问题

Some users have have faced a hangout problem when whey press the quit button. Currently the following symptom and work-around have been noticed:

  • Press Ctrl-Alt-Backspace to kill X-Window and show the GDM screen.
  • gnome-power-manager service should be on. You can enable it from System->Preferences->Sessions.
  • Wait for 1 minute. The quit window will appear. (the logout problem will vanish for some times).
  • For some users, removing .config/autostart/ directory worked.

Tips And Tricks

It is pointless to add the tricks that is already added in Ubuntu:Feisty#Tips_And_Tricks. So, only new tricks are added.

如何查找设备的 UUID

  • This is useful if changes are made to the partition table or a new hard drive is added to the computer.
  • When the UUID(s) change an error will be caused during boot.
  • Pressing <Ctrl>-D will allow the boot to continue but to fix the problem:

-> Open fstab file:

sudo gedit /etc/fstab

-> In another terminal run this commmand:

ls -l /dev/disk/by-uuid/  

-> Or you can type this to list all of your devices:

blkid
  • Compare the UUID's and any that are different in fstab from the list must be changed. The easiest way is copy and paste.
  • Some other things may have to be edited as well like the mount point, type (ext2, ext3, ntfs, etc) , options, dump, pass, etc.

For more help editing fstab look Here:

  • To list the UUID of a specific device:
sudo vol_id -u device
  • Where device might be /dev/sdxy.

Example: sudo vol_id -u /dev/sda1

启用 vim 语法高亮显示

The source of vi/vim command is vim-tiny package which does not support syntax highlighting. Install vim:

sudo apt-get install vim

Then open /etc/vim/vimrc and uncomment syntax on

HAL

If you have problem failed to initialize HAL, and devices such as card reader,or shutdown problem, power meter doesn´t appear..please find this line in /etc/init.d/rc

sudo vim /etc/init.d/rc find this line : CONCURRENCY=shell

To fix this:

sudo nautilus

Navigate to /etc/ look for the folder rc2.d rename s12hal to s13hal

the problem was HAL loading before DBUS and causing such error. this should fiz the problem, if not

sudo gedit /etc/init.d/rc

and turn CONCURRENCY=shell to CONCURRENCY=none

启用 Firefox 的 Sirius 互联网广播

Launch the player from www.sirius.com. After authenticating, you will now be able to select which stream to play. Selecting the stream will launch vlc.

指南开发

Note: This section was taken from the Feisty Guide and edited appropriately.

Place ideas here to increase the look and performance of this guide.

  • Add a new section for Gnome Themes from http://art.gnome.org and KDE Themes from http://www.kde-look.org/.
  • Have entries under their headings in alphabetical order.
  • Try to keep the guide neat and clutter free.
  • Possible "Short Version" Table of contents without each "How to".
  • Add a [top] link to the end of each article.
  • If possible, include a 'find/search' function to easily access queries.
    • This can be done in Firefox with <Ctrl>-F.
Personal tools