顯示具有 install 標籤的文章。 顯示所有文章
顯示具有 install 標籤的文章。 顯示所有文章

2011年1月23日 星期日

Install sun-java5-* in debian squeeze

Debian Squeeze 已經把 sun-java5-* (亦即 java 1.5 )拿掉了,統統換成了 sun-java6-* (亦即 java 1.6)「註:這裡 * 代表 jre, bin, jdk, demo 等等部份」。
可是 Android 開發環境會檢查 java 環境,仍然需要 java 1.5 ,怎麼辦呢?
可以用 dpkg --force-depends 強制安裝 sun-java5-*  ,方法如下:

1. 首先下載 Lenny 版本的 package :
sun-java5-bin_1.5.0-22-0lenny1_i386.deb
sun-java5-jre_1.5.0-22-0lenny1_all.deb
sun-java5-demo_1.5.0-22-0lenny1_i386.deb
sun-java5-jdk_1.5.0-22-0lenny1_i386.deb

2  因為 bin 依賴於 jre , jre 依賴於 bin, jdk 依賴於 demo, demo 依賴於 jdk 。
所以用強制 depends 選項(把依賴關係列為 warning 而非 error )就可以順利安裝,指令為:
#> dpkg --force-depends -i  sun-java5-bin_1.5.0-22-0lenny1_i386.deb\
  sun-java5-jre_1.5.0-22-0lenny1_all.deb\
  sun-java5-demo_1.5.0-22-0lenny1_i386.deb\
  sun-java5-jdk_1.5.0-22-0lenny1_i386.deb

3. 切換內定 java version :
#> sudo update-java-alternatives -s java-1.5.0-sun
如果出現一堆跟 firefox plugin 的錯誤訊息,像這樣:
update-alternatives: error: alternative /usr/lib/jvm/java-1.5.0-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so for firefox-javaplugin.so not registered, not setting.
...
不用管它,因為我們 compile Android 時應該不會用到 firefox 的 java plugin。

4. 驗證 java version :
#> javac -version
應該就可以看到 java 1.5 的訊息了!
#


2010年11月26日 星期五

忽然想要列印 man page 怎麼辦?

老 Unix 玩家應該覺得很簡單,但對於新手的我還是要紀錄一下:
1. 先由命令查閱要列印的 man page 再哪裡? 例如 :
tom@glest:~/temp$ man -w groff
/usr/share/man/man1/groff.1.gz
2. 原來是有壓縮的,知道後就可以印了:
tom@glest:~/temp$ zcat `man -w groff` | groff -m man -T ps - | lpr

這裡 groff 是排版用的指令,輸入格式為 man page ,輸出格式為 ps 。
That's it !

p.s. 當然你的 lpr 要正確才行,如果有裝好 cups,下列命令就可以看到系統印表機狀態:
tom@glest:~/temp$ iceweasel http://localhost:631/admin



2010年8月17日 星期二

lpr and cups troubleshooting

Bad situation encountered :
系統是 Debian/Testing.
透過 browser 瀏覽 http://localhost:631 可以透過 CUPS 管理印表機,目前我系統是安裝 CUPS 1.4.4。
使用其中的 Administration | Maintenance -> Print Self Test Page 可以順利印出測試頁面。
但是 emacs 裡面要列印時,就出問題了: 使用 print buffer 命令根本沒反應!

Troubleshooting :
因為 emacs 使用 `lpr' 指令作列印動作 --- 改用 `lpr' 指令試著列印一個文字檔 --- 也失效。
用 `lpq' 觀察 printing jobs 發現都在 spool 上,卻沒有送到 printer 。
觀察 debian 套件關係,原因是 cups-bsd-1.4.4-2 沒有裝,反倒是 lpr-2008.05 套件有裝上,這兩個是 conflict 的套件,因為都有提供 `lpr' 等指令。
但是前者提供 printing commands (i.e. `lpr') interactive with the CUPS. 必須裝這個套件而不是 `lpr-2008.05' 套件
這次裝錯套件的現象,可能是以前 upgrade 時沒有仔細看就同意用 lpr 套件來取代。
移除 `lpr-2008-05' 並裝上 `cups-bsd-1.4.4-2' ,重新啟動 cupsd 還不夠;可能是我還有 daemon 沒有重起,或是 debian 套件系統沒有正確的 post processing,就沒有去追究了。
試著重新開機, work !






2009年12月13日 星期日

Debian 升級 testing (sqeeze) 與 ATI X1450 的 driver 問題

Asus A8J 大約是兩三年前的華碩主流筆電之一,獨立顯卡採用  ATI X1450.
Debian Lenny 下有提供 ATI propietary driver (non-free) :
kernel driver(要 3D 加速,需要 kernel driver ) : fglrx-modules-2.6.26-* 等,driver source : fglrx-kernel-src
for openGL lib : fglrx-glx
根據這篇 [ arch linux ATI ] [ref 1] 知道,X1450 的 code name 為 (RV515, 即 r5xx  系列)

Debian 系統升級到  testing 後,kernel driver 套件變成 : fglrx-source , 且改為支援 r6xx-r7xx 而已,也就是說 ATI 官方 driver 不再支援 r5xx 系列,
但是這些不被支援的系列的 spec 已經  release 給 open source 社群。所以目前升級後的  xorg 7.4 裡面的  xserver-xorg-video-ati 套件,可以支援 r5xx 系列。
xorg.conf 已經不需要了,xorg 會自動偵測掛載  radeon driver。

glxgears 的數據為
1598 frames in 5.0 seconds = 319.450 FPS 
1613 frames in 5.0 seconds = 322.503 FPS  ( 本blog時間測)

6097 frames in 5.0 seconds = 1219.223 FPS 
6014 frames in 5.0 seconds = 1202.697 FPS  ( 2010年4月20測)

跟使用 ATI propietary ~1200 FPS 比較起來,稍稍等待 open source 社群是值得的,
時間會證明 open source community 提供的 code 效能,總會超越 propietary code 的,並且更穩定。
Technorati 標籤: , , ,

2009年11月13日 星期五

eclipse + CDT for C++ Development

這篇說明 eclipse 的設定,為了怕設定的部份翻譯不好,乾脆用英文寫...

Since `cscope + ecb + emacs' is my favorite development tool, there is no need for "eclipse", while not all people get used to `emacs' conveniently. Here we introduce another good IDE for C/C++ developemnt --- Eclipse !!

1. From [ http://www.eclipse.org/downloads/ ] download `Eclipse IDE for Java EE...' or `Eclipse IDE for Java...' or `Eclipse IDE for C/C++...', I download the eclipse-jee-galileo-linux-gtk.tar.gz  , extract,  then add path (where you untar eclipse ) to ~/.bashrc such that when I type `eclipse' command so that it can be brought up (Yes, its green software).

2. Install the CDT plugin : (If you use `Eclipse IDE for C/C++' , please skip this step)
In eclipse menu, goto (Help | Install New Software ...) then type this html page:
http://download.eclipse.org/tools/cdt/releases/galileo
(note : CDT need > eclipse 3.5 or up )
then update. The CDT component will then be installed.

3. Create C++ project :
In eclipse menu, goto "File | New | Project...|C++":
   a. Fill "Project Name".
   b. Select Makefile Project | Empty Project.  <--- yes, choose `Empty Project' for the external Makefile case !!
   c. Select Linux GCC at the right side.
   d. Press the "Finish" button.
then you have created an empty project in eclipse.

4. Import external sources/Makefile to project:
Right click on the project name, select "import...":
choose "General | File System" , click "Next" button, then "browse" to your source path, (of,course, you can filter out unnecessary files ) then press "Finish".

5. Goto "Project | properties| C/C++ Build", in the right "Build Location" field, press the "workspace" button, and given your project path , for e.g. ${workspace_loc:/test/home/tom/external_open_source}. (I was fooling around here for 6 hours --- before I learn to press the "workspace" button)

Then press "OK", the project will be built. But in our `external_open_source' project, we need use `make opt' as the building command ---goto "Project |Proties" , in "C/C++ Build",
a. select the "Behavior" tab,
b. uncheck "Build on resource save(Auot build)",
c. modify "Build (Incremental build)" to "opt",
d. then press "OK" to finish.

Now, you should build the `external_open_source'  sucessfully, instead of the 'No rule to make target `opt' error message !

ps. In Debian Lenny, make sure to use

$update-alternatives --config java

to configure your default java to `java-6(5)-sun' instead of `java-gcj' , the Eclipse will NOT start with `java-gcj' as the default java environment:

  Selection    Alternative
-----------------------------------------------
              1    /usr/bin/gij-4.3
              2    /usr/lib/jvm/java-gcj/jre/bin/java
*+          3    /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number: 3
 
Technorati 標籤: ,

2009年8月28日 星期五

使用 debootstrap 安裝 Debian 於 USB 大拇哥

網路上相關文章很多,但是多半有"手工"打許多指令的步驟,不適合懶人使用。
[ Install Debian on USB ]這篇Wiki前半部直到 Configure Locales 的部份做完,寫得很簡明,接下來是該作者自己的 Casper package 安裝,就不用再繼續 follow up 了。

所以歸納一下步驟如下:
1.  準備好 partition 以安裝 debian。這視個人的大拇哥規劃而定,以下假設裝在 /dev/sdb2(sda 是本機上的硬碟)
以下用 /dev/sd{D}{N} 表示,請自行代換之。

2.  準備好檔案系統 ,並且 mount 到 /mnt
#> mkfs.ext3 /dev/sd{D}{N}
#> mount /dev/sd{D}{N} /mnt

3.   重頭戲來了,從 /etc/apt/sources.list 找一個 mirror site 這裡用 http://debian.nctu.edu.tw/debian/ (要含有斜線)
#> debootstrap lenny /mnt http://debian.nctu.edu.tw/debian/
     接下來會一直抓 package 來安裝,泡盃咖啡去...

4   準備兩個設定檔,一個在裝 kernel 時會用到,另一個是 sources.list,可以直接使用 host 的 /etc/apt/sources.list
#> mkdir -p /mnt/etc/apt
#> echo "do_initrd=yes" > /mnt/etc/kernel-img.conf
#> cp /etc/apt/sources.list  /mnt/etc/apt/

5   準備 fstab 給新系統 (/etc/inittab 則不需煩惱,debootstrap 會 setup inittab)
#> echo "/dev/sd{D}{N}  /  ext3  defaults,errors=remount-ro 0" > /mnt/etc/fstab
#> echo "proc /mnt/proc  proc  none 0 0" >> /mnt/etc/fstab
#> mount proc /mnt/proc  -t  proc

6   接下來用 chroot 切換到新的系統去,
#> chroot /mnt
請注意:經過這步驟,接下來,所有的指令都是下給新系統的了!

7   先設定好 locale 並且把從 host 繼承的 locale 先設空
#> apt-get update
#> apt-get install locales
#> dpkg-reconfigure locales
#> export LANG=
#> export LANGUAGE=
localepurge 是個可裝可不裝的套件,若要省空間,可以這時候裝起來
#> apt-get install localepurge
將來裝套件時 localepurge 可幫忙 free 一些不需要的 locales 資料

8   然後安裝 kernel image,遇到問題都選 y
#> apt-get install linux-image-2.6.26-2-686

9 裝 grub package
#> apt-get install grub

10 將 grub 裝到 MBR :
#> exit
請注意:接下來,我們又回到 host 了!
#> grub-install --root-directory=/mnt --no-floppy --recheck /dev/sd{D}
#> cat > /mnt/boot/grub/menu.lst << EOF
title        Debian GNU/Linux, kernel 2.6.26-2-686
root        (hd0,1)
kernel        /boot/vmlinuz-2.6.26-2-686 root=/dev/sd{D}{N} ro
initrd        /boot/initrd.img-2.6.26-2-686
EOF
這裡把 (hd1,1) 換成了 (hd0,1)  。因為若是用  usb 開機的話,grub 把大拇哥當第一顆硬碟 (hd0), 直到進了 kernel 才又跟 host 所認知的一樣---回到 sdb。


11 打完收工
#> umount /mnt/proc
#> umount /mnt

這樣就有一個可用的 Debian on USB 了!
後記:grub 安裝時,如果抱怨找不到 grub drive 或 stage1 的問題,[這裡]有解答
Technorati 標籤: , ,