顯示具有 電腦-ubuntu 標籤的文章。 顯示所有文章
顯示具有 電腦-ubuntu 標籤的文章。 顯示所有文章

2011年9月21日 星期三

Ubuntu 安裝 Java Runtime Environment

安裝gcc/g++/gdb/make 等基本編程工具

 sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts


如果無法安裝則要在 /etc/apt/sources.list 加入 "deb http://archive.canonical.com/ lucid partner"

或是輸入下列指令


sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”




sudo apt-get update



之後再執行最前面的指令安裝即可,也可用java-version確認版本

在Ubuntu 64 OS下執行ADB會出現No Such file or directory

1. 使用 ls -l adb  列出執行時期需要的shared library 無效
2. 安裝lib32ncurses5和lib32stdc++6 正解



sudo apt-get install lib32ncurses5 lib32stdc++6



Ubuntu 12.04
尋找 ia32-libs 並安裝




2011年1月13日 星期四

使用 Linux 對Android Device下ADB的設定

1. 開啟Android device 的DEBUG MODE
2. 複製 51-android.rules到 /etc/udev/rules.d
sudo cp 51-android.rules /etc/udev/rules.d
3. 更該檔案權限
chmod a+r 51.android.rules
4. 複製 platform-tools裡面的ADB到 /bin 裡面
5. reboot the Linux

2013/01/25 補充

1. 下載51-android.rules
2. 解壓縮後把Owner改成ubuntu的帳號
3. 複製到/etc/udev/rules.d
4. 更改檔案權限

51-android.rules

如果還是不行
1. 利用lsusb取得VID與PID

Bus 001 Device 008: ID 18d1:4e22 Google Inc. Nexus S (debug)

18d1=Vendor ID, 4e22=Product ID

2. 把以下內容加入51-android.rules

SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e22", SYMLINK+="android_adb", MODE="0666"

Reference
Using Hardware Devices
51-android.rules -- 一个文件搞定Ubuntu上Eclipse不识别Android手机的问题
51-android.rules详解

2009年9月16日 星期三

輸入法的安裝與切換

1. 安裝gcin
開啟終端機,輸入
sudo apt-get update
sudo apt-get install gcin

2. 將gcin設為預設的輸入法
im-switch -z zh_TW -s gcin
重新登入後生效。


◎若想換回 SCIM
im-switch -s scim

FireFox與scim衝突解決方法

編輯 /usr/bin/firefox或/usr/bin/acroread 並在文件最開頭輸入以下內容:

XMODIFIERS=@im=scim
GTK_IM_MODULE=scim-bridge
export XMODIFIERS GTK_IM_MODULE



MOZDIR=$HOME/.mozilla
13 LIBDIR=/usr/lib/firefox-3.0.3
14 APPVER=3.0
15 META_NAME=firefox
16 GDB=/usr/bin/gdb
17 DROPPED=abandoned
18
19 XMODIFIERS=@im=SCIM
20 GTK_IM_MODULE=scim-bridge
21 export XMODIFIERS GTK_IM_MODULE

之後重新啟動firefox即可

2009年9月15日 星期二

安裝 Deluge 1.1.9

Deluge 1.1.9來源:http://download.deluge-torrent.org/source
Ubuntu 用户安方法:
在Ubuntu-tweak里有Deluge安装,但是只有Deluge 1.1.6 版的。
下面说明如何安装Deluge 1.1.9版:
添加源:
  • 可以用Ubuntu-tweak的源编辑器添加
  • 也可以在终端输入: sudo gedit /etc/apt/sources.list
Ubuntu 9.04 Januty
  • deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu jaunty main
  • deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu jaunty main
Ubuntu 8.10 Intrepid
  • deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu intrepid main
  • deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu intrepid main
Ubuntu 8.04 Hardy
  • deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu hardy main
  • deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu hardy main
加入公鑰:
  • sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 8eed8fb4a8e6da6dfdf0192bc5e6a5ed249ad24c
注意:增加失敗,但是不管他。之後可能會出現程式未通過認證的訊息
更新:
  • sudo apt-get update
  • sudo apt-get dist-upgrade
這兩步驟之後還是有問題,直接以套件管理員搜尋
應該可以找到新版套件來安裝了

2009年9月11日 星期五

安裝 Moblin 的方法

Step 1: Download the Live Image

The live image is available from the test drive page. Save the image to a known location so you can access it in step 2.

Step 2: Byte-copy the image to a USB drive or burn to CD

Write image to a USB drive

You will need a USB drive with at least the capacity of the downloaded image.
Note: A byte-exact copy of the ISO image must be placed on the USB drive. It is not sufficient to simply copy the image file to the drive.
Note: The contents of the USB drive will be completely erased.
Linux Be sure the USB drive is unmounted before proceeding. Some Linux distributions auto mount the USB drive when it is inserted, which can cause corruption when writing.
# umount

Use either of these two methods:
  • Image Writer (recommended, requires Python >=2.4)
    Image Writer is a small python executable script that detects your USB drive and writes the image to it. The advantage of using image writer is that it will not inadvertently overwrite your system hard drive.
    Download Image Writer (Right-click, Save Link As...)
    # cd
    # chmod a+x ./image-writer
    # ./image-writer
  • Use 'dd' from the command-line
    Caution: 'dd' will overwrite any destination including your system hard disk. Make sure you know the correct value of before proceeding.
    # dd bs=4096 if= of=
Windows There is a simple way to put the Moblin image on a USB drive.
  1. Download the Win32DiskImager.exe program: https://launchpad.net/win32-image-writer/+download (zip file)
  2. Unzip the file and extract the contents to a known directory
  3. Run W32DiskImager.exe (screenshot)
  4. Select the Moblin image file (.img)
  5. Select the drive letter which corresponds to the USB key
  6. Click the "Write" button to byte-copy the image to the USB drive.
Mac OS X Be sure the USB drive is unmounted before proceeding. OS X auto mounts the USB drive when it is inserted, which can cause corruption when writing. You can press the eject icon in Finder or drag the USB icon to the trash.
Use this method (thanks to Many Ayromlou for the instructions):
  1. Open a Terminal (Applications -> Utilities -> Terminal)
  2. Run
    diskutil list
    to get the current list of devices
  3. Insert your flash media
  4. Run
    diskutil list
    again and determine the device node assigned to your flash media (e.g. /dev/disk2)
  5. Run
    diskutil unmountDisk /dev/diskN

    (replace N with the disk number from the last command; in the previous example, N would be 2)
  6. Run
    sudo dd if=/path/to/downloaded.img of=/dev/diskN bs=1024
    (replace /path/to/downloaded.img with the place you downloaded the image. You'll need your password for this.
  7. Run
    diskutil eject /dev/diskN
    (where N is the number we found above) and remove your flash media when the command completes
  8. You're done! Plug that USB into a netbook and enjoy Moblin

Burn image to CD

Before proceeding, make sure your target device has a CD player. Many netbooks do not. You can also use an external CD player that plugs into a USB port.
Note: A byte-exact copy of the ISO image must be placed on the CD. It is not sufficient to simply copy the image file to the CD.
Linux cdrecord
  1. Insert a blank CD into the CD burner.
  2. Find the device file associated with your burner (/dev/... ).
    $ cdrecord --devices
    Sample output:
    -------------------------------------------------------
    0 dev='/dev/scd0' rwrw-- : '_NEC' 'DVD+RW ND=1100A'
    -------------------------------------------------------
  3. Burn the image to the CD.
    $ cdrecord -dev= -tao
    Example:
    $ cdrecord -dev='/dev/scd0' -tao
Windows Most Windows CD-writing tools have the ability to burn an iso image. Here is one option.
iso recorder
  1. Download isorecorder. Install the program.
  2. Follow this tutorial.

Step 3: Boot the image on your netbook, MID, or PC

Insert the USB drive into your netbook and reboot. Make sure that the netbook boot order tries the USB drive first.


參考連結:http://moblin.org/documentation/test-drive-moblin/using-moblin-live-image

2008年10月15日 星期三

Ubuntu 8.04 安裝virtualBox

本文適用於Ubuntu 8.04 LTS(Hardy Heron)。
Screenshot-Sun xVM VirtualBox
近日發布的VirtualBox 1.6版已正式定名為Sun xVM VirtualBox,代表VirtualBox正式成為Sun家族的一員。新版的VirtualBox圖示和開機畫面也變得更漂亮,執行速度更快,幾乎 跟實機沒有什麼兩樣了,非常適合裝在Ubuntu裡,用來處理一些目前非Windows不可的事,例如ATM轉帳或特殊軟體,運作起來也會比用WINE去 模擬來得穩定,不過它的缺點是還不支援DirectX,所以想在VirtualBox裡的Windows玩遊戲,可能要再等一等。
以下說明安裝步驟:
下載及安裝VirtualBox
直接下載或利用套件庫安裝方式二選一:
直接下載
1. 先至下載頁面,依照作業系統版本,進行下載,Sun很貼心的幫每個作業系統都準備好安裝程式,Ubuntu 8.04也不例外。
2. 下載回來是個deb檔,用滑鼠在上面點兩下就可以安裝。
套件庫安裝
1. 「設定」→「套件庫」→「第三方軟體」→「加入」,加入下列來源:
deb http://download.virtualbox.org/virtualbox/debian hardy non-free
2. 開終端機,下指令,加入公鑰:
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -
3. 用Synaptic套件管理程式重新載入套件庫後,搜尋virtualBox,然後進行安裝。
ps.Ubuntu 8.04的套件庫中也有VirtualBox的開放原始碼版本(OSE),但版號較舊。
設定帳號權限
1. 上述安裝步驟中,安裝程式會自動在系統中加入vboxusers這個群組名稱。
2. 接著,從選單「系統」→「管理」→「使用者及群組」,按下方「解除鎖定」,輸入管理密碼後回到主畫面,按「管理群組(M):」進入群組設定名單。
3. 尋找vboxusers這個群組名稱(通常在最底下)。
4. 點選vboxusers後,選擇「屬性」,將允許使用VitualBox的使用者都勾選起來,就完成權限設定了。
設定完後,要記得重新登入或重啟系統,設定才會生效。

設定使用usb裝置的權限
1. 在「系統」→「管理」→「使用者及群組」→「管理群組(M):」中新增群組「usbusers」(注意此處的「群組識別碼」下面設定usbfs的步驟會用到),並將允許使用VitualBox的使用者都勾選起來。
設定完後,要記得重新登入或重啟系統,設定才會生效。
啟動Ubuntu 8.04的usbfs
Ubuntu 8.04中預設關閉usbfs的支援,會導致VirtualBox出現以下錯誤:
Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might be not installed on the host computer.
為了修正這樣的錯誤,請開終端機,下指令:
sudo gedit /etc/init.d/mountdevsubfs.sh
開啟後,找:
#
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb
將最後四行的#去掉,如下所示:
#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
存檔後,再執行:
sudo /etc/init.d/mountdevsubfs.sh start
再下指令:
sudo gedit /etc/fstab
在檔尾加入以下這行:
none /proc/bus/usb usbfs devgid=1001,devmode=664 0 0
注意裡面的devgid就是上述設定權限步驟中的「群組識別碼」。
最後請重新開機或是下指令:
mount /proc/bus/usb
就不會再出現錯誤訊息了,也能夠正常使用usb裝置了。
0606 update:
感謝Jason補充,以下來函照刊:
其實在/etc/fstab中加入
usbfs /proc/bus/usb usbfs defaults 0 0
就okay了
安裝Windows虛擬系統
這裡大略說明設定流程,安裝Windows的細節部份就不再贅述。
1. 選「新增」,設定虛擬機名稱、磁碟(映像檔)及記憶體大小,若不太清楚這些是什麼東西,保持預設值即可。
2. 回到VirtualBox主畫面,上方選「設定值」,勾選「掛載光碟機」和「啟用USB控制器」。其餘選項依個人需求進行變更。
3. 用Windows安裝光碟開機,依一般安裝方式進行安裝即可。
ps.有一種利用Ghost製作而成的快速安裝XX版的Windows會無法在VirtualBox內安裝,請選用以正常方式安裝的版本。
無法捕捉滑鼠指標的解決方法
剛裝好Windows虛擬機時,可能會碰上滑鼠指標失效的問題,解決方式是加裝VBoxGuestAdditions(客端額外功能)(安裝請見下一節),但是沒有滑鼠可以點選怎麼安裝呢?方法有二:
1. 暫時關掉Ubuntu系統內的Compiz Fusion桌面特效,捕捉滑鼠功能會恢復正常,然後就可以用滑鼠點選安裝了。
2. 利用鍵盤在Windows裡操作安裝步驟,不熟悉鍵盤操作的人,可能會不太習慣,可是這是最快速又不用關桌面特效的方法。
增加VBoxGuestAdditions(客端額外功能)
1. 請選擇上方「裝置」中的「安裝客端額外功能」,XP會自動將VBoxGuestAdditions掛載成虛擬光碟,通常都會自動執行安裝程式,若沒有的話,就進光碟裡執行安裝程式即可。
2. 安裝好後,最大的好處就是不用再按右邊的ctrl來切換主客之間的滑鼠和鍵盤。
3. 其它額外增加的功能包括「自動調整客端顯示大小」及「無縫模式」等。
開啟無縫模式
如果你依照上述步驟安裝VirtualBox,而且也把VBoxGuestAdditions(客端額外功能)安裝上了,那麼重新開機後就可以使用無縫模式功能了,預設的快捷鍵是右邊的Crtl+L。
安裝與使用usb裝置
1. 打開VirtualBox,點選「設定值」→「USB」→「啟用USB控制器」。
2. 先插上你要用的usb裝置。
3. 按右邊「+」號,增加剛剛插上的usb裝置,按「確定」,完成。
解決host key無法生效的問題
感謝史考特補充,以下來函照刊:
感謝您介紹這麼好的免費VM軟體!
拜您這篇文章以及「企鵝幫魚,魚幫兔」網站所賜,我在安裝時十分順利。
不過有一點小小分享,就是我在安裝WinXP到VB中,發生host key無法生效的問題。在網路上找了一陣子,才知道原來問題出在SCIM輸入工具的問題。後來照著下面這個討論的第三個回應順利解決問題。提供給同樣有這個問題的網友參考。
http://www.uluga.ubuntuforums.org/showthread.php?p=4937819
還有,如果不確定自己的CPU有支援Virtualization,千萬不要把這個VT-x/AMD-V選項打勾,否則你的host OS會無法順利啟動。
感謝chinyue補充,以下來函照刊:
提供 host key 問題的另一個解法,在 Terminal 中以
XMODIFIERS= VirtualBox
來啟動 VirtualBox。

資料來源:

在Ubuntu 8.04中安裝VirtualBox

2008年9月28日 星期日

使用emacs來建立一個程式開發環境

emacs是一套非常好用的文書編輯軟體,透過安裝其他相關的plug-in之後可以快速的在程式碼中找到你所需要的涵式以及變數。但是emacs需要使用大量的快速鍵來操作,因此上手會比較困難但是絕對是非常好用。網路上將使用Linux作為開發環境的人分為三種:使用emacs、使用vim以及其他
由此可以知道emacs在這方面是如何的受到推崇

要達成上圖的功能,需要以下的軟體配合:
  1. cscope (version 15.6) cscope是一個代碼流覽工具,它可以幫你在一個大的工程中,快速定位到一個函數/變數的聲明位置,所有引用地方等,它可以結合vimemacs一起使用。
    單獨使用cscope時不同檔間的跳轉變得很難處理,這裏我們介紹cscopeemacs環境中的
    使用;
  2. cedet-1.0pre4 ecb需要依賴這個;(安裝ecb後會自動安裝)
  3. ecb-2.32 :這個是emacs的插件,可以在emacs中劃分好幾個不同的視窗,比如源代碼視窗,
    工程目錄視窗,方法視窗等;
  4. emacs-22.1.1
  5. display-line-number.el 顯示行(可不裝)

安裝方法如下:
1. 執行終端機
2. 輸入以下指令安裝軟體
sudo apt-get install escope
sudo apt-get install ceb
sudo apt-get install emacs
如果escope無法安裝,也可以利用套件管理程式安裝


3. 在使用者的根目錄 /home/[user name]建立或修改.emacs這個檔案,並加入以下內容
(load-file "/usr/share/emacs/site-lisp/cedet-common/cedet.el")
(load-file "/usr/share/emacs/site-lisp/ecb/ecb.el")
(global-set-key "\M-g" 'go-toline)
(global-set-key "\M-m" 'set-mark-command)

4. 在終端機下執行emacs呼叫程式
5. 在emacs下按 alt-x 然後輸入ecb-activate即可完成

參考資料
用Open Source工具開發軟體
Emacs 使用手冊
Emacs WiKi
GNU Download emacs

2008年9月12日 星期五

在Ubuntu下使用C語言寫程式所需要的套件

安裝命令:

安裝gcc/g++/gdb/make 等基本編程工具
sudo apt-get install build-essential
安裝 libgtk2.0-dev libglib2.0-dev 等開發相關的庫文件
sudo apt-get install gnome-core-devel
用於在編譯GTK程式時自動找出頭檔及庫檔位置
sudo apt-get install pkg-config
安裝 devhelp GTK文檔查看程式
sudo apt-get install devhelp
安裝 gtk/glib 的API參考手冊及其它幫助文檔
sudo apt-get install libglib2.0-doc libgtk2.0-doc
安裝基於GTK的介面構造程式
sudo apt-get instal glade libglade2-dev

sudo apt-get install glade-gnome glade-common glade-doc


sudo apt-get install libgtk2.0-dev


安裝GTK環境只要安裝一個gnome-core-devel就可以了,裏面集成了很多其他的包。除此之外還要轉一些其他的東西,如libglib2.0 -doclibgtk2.0-doc幫助文檔,devhelp幫助文檔查看,glade-gnomeglade-commonglade-doc圖 形介面設計等。
使用外部命令查看安裝的gtk的版號

$pkg-config --modversion gtk+ (查看1.2.x版本)
$pkg
-config --modversion gtk+-2.0 (查看 2.x 版本)
$pkg
-config --version (查看pkg-config的版本)
$pkg
-config --list-all grep gtk (查看是否安裝了gtk)

Emesene 不正常關閉

在ubuntu 8.04中,有時候esmesene在登入後會不正常關閉
原因可能是8.04裡的emesene和gcin衝突
解決方法是編輯/etc/X11/xinit/xinput.d/zh_TW 或 ~/.xinput.d/zh_TW
把GTK_IM_MODULE=gcin改成GTK_IM_MODULE=xim
之後重新啟動就可以了

PS. 如果有使用gdm這類的管理程式要記得手動關掉然後再重啟才有用)
如果不怕麻煩的可以在每次啟動後從終端機執行

export GTK_IM_MODULE=xim emesene;emesene

2008年9月11日 星期四

Ubuntu必裝軟體

MSN: Emesene
1. 從套件管理員選擇
2. 執行終端機
sudo apt-get install emesene
BBS: PCManX
執行終端機
sudo sudo apt-get install pcmanx-gtk2要使用時執行pcmanx

中文輸入:gcin
已加入官方套件,直接由套件管理員安裝

燒錄軟體: GnomeBaker
已加入官方套件,直接由套件管理員安裝

BT軟體: KTorrent
已加入官方套件,直接由套件管理員安裝

模擬器: VirtualBox
1. 到官方網站下載
2. 執行終端機
sudo apt-get install virtualbox

參考資料:
Ubuntu -為藍星人打造的Linux作業系統
[教學] emesene - Linux 底下的 MSN 即時通
[Ubuntu] 安裝 PCManX
[Ubuntu] VirtualBox on Ubuntu 8.04 Hardy