從 debian stable 升級到 testing 或 linuxmint 升級到 testing 後,scim 會造成在 Gnome Terminal 打字時,感覺卡卡的。
後來在
http://bus.debian.org/cgi-bin/bugreport.cgi?bug=434180
找到暫時的解決方法是到
/etc/scim/config 或 ~/.scim/config 把
/FrontEnd/X11/dynamic 的值從 false 改為 true。
星期二, 2月 28, 2012
GRUB 安裝失敗,無法將 grub-pc 套件安裝到 /target/ 中
真是有夠瞎...
用 unetbootin 將 debian-live-6.0.3-amd64-gnome-desktop.iso 弄進 usbdisk 中,安裝在 SSD 中。
由於使用無線網卡,無法連線到 AP ,想說跳過連網的步驟,裝完再來設。
沒想到中途出現
GRUB 安裝失敗,無法將 grub-pc 套件安裝到 /target/ 中的訊息,最後竟在對岸找到說是因為網路不通造成的。
在半信半疑下,拉了條實體的線來,竟然就過了...真是無言...
星期日, 10月 30, 2011
find the icon of google chrome in Debian
After install google chrome from google dl.
I can't find the icon of google chrome.
Then I found this
http://forums.debian.net/viewtopic.php?f=6&t=53346#p386886
Just copy a file.
Then the icon appear.
20120620 updated
These places also works too !
Reference:
http://askubuntu.com/questions/96080/how-to-set-google-chrome-as-the-default-browser
I can't find the icon of google chrome.
Then I found this
http://forums.debian.net/viewtopic.php?f=6&t=53346#p386886
Just copy a file.
$ sudo cp /opt/google/chrome/google-chrome.desktop /usr/share/applications/
Then the icon appear.
20120620 updated
/usr/share/applications/
/usr/local/share/applications/
~/.local/share/applications/
These places also works too !
Reference:
http://askubuntu.com/questions/96080/how-to-set-google-chrome-as-the-default-browser
星期六, 4月 03, 2010
Debian 惱人的中文資料夾名稱
最近我的 Debian 做了更新後,也出現了在 Ubuntu 才會看到的 桌面,文件,圖片,音樂,下載等的中文資料夾。在終端機下工作時,要進去這些資料夾變得有點礙手礙腳的。
在網路上找到一篇解決方法。
ubuntu 恼人的中文文件夹如何解决
http://blog.csdn.net/ablo_zhou/archive/2010/03/18/5392987.aspx
節錄如下:
1. 先將資料夾名稱都改成英文的
執行下面指令,切換到英文環境
export LANG=en_US
再執行
xdg-user-dirs-gtk-update
這時會跳出一個設定頁面,問你要不要將所有的中文資料夾換成英文。把不要再問我勾選起來後,確定。
此時,在“位置”裡原本是中文的名稱已經換成英文了。接著把原來中文資料夾裡的資料移到英文的資料夾即可。
再執行下面指令,就可以切換回到中文的環境了
export LANG=zh_TW.UTF-8
2. 顯示中文,但實際是英文資料夾
這時,在“位置”裡所顯示的是英文,我們接下來讓這裡顯示成中文,但點進去是到英文的資料夾。例如:點“文件”會打開 "/home/user/Documents"
點“位置” -> “家目錄”,以打開檔案瀏覽器。
點“書籤” -> 編輯書籤
在這個設定頁面中,將每個書籤的“名稱”欄位改成你想要的中文名稱就可以了。
星期四, 3月 04, 2010
Failed to reopen debug port for Selected Client to XXXX
這是 Debian-based 的 Linux 特有的 bug...
事情發生在安裝好 sun-java6-jdk, eclipse, ADT 之後,打開 Window -> Android SDK and AVD manager 時,Eclipse 的 Console 視窗會開始一直跳出下面這樣的訊息
拜過谷歌大神後,得到解法如下
重開機後也要保持設定值,則修改 /etc/sysctl.d/bindv6only.conf 裡的的設定值為
原因請參考下面這兩篇...
http://groups.google.com.tw/group/android-developers/browse_thread/thread/85ca7f2498e8f89c?fwc=1
及
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560142
事情發生在安裝好 sun-java6-jdk, eclipse, ADT 之後,打開 Window -> Android SDK and AVD manager 時,Eclipse 的 Console 視窗會開始一直跳出下面這樣的訊息
[2010-03-04 23:04:42 - ddms]Failed to reopen debug port for Selected Client to: 8700
[2010-03-04 23:04:42 - ddms]不適用的引數
java.net.SocketException: 不適用的引數
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at com.android.ddmlib.MonitorThread.reopenDebugSelectedPort(Unknown Source)
at com.android.ddmlib.MonitorThread.run(Unknown Source)
[2010-03-04 23:04:42 - DeviceMonitor]Connection attempts: 1
[2010-03-04 23:04:43 - DeviceMonitor]Connection attempts: 2
[2010-03-04 23:04:45 - DeviceMonitor]Connection attempts: 3
拜過谷歌大神後,得到解法如下
sudo sysctl -w net.ipv6.bindv6only=0
重開機後也要保持設定值,則修改 /etc/sysctl.d/bindv6only.conf 裡的的設定值為
net.ipv6.bindv6only = 0
原因請參考下面這兩篇...
http://groups.google.com.tw/group/android-developers/browse_thread/thread/85ca7f2498e8f89c?fwc=1
及
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560142
星期二, 3月 02, 2010
Install Sun Java6 JDK in Debian
Install Sun Java6 JDK
Set java provider in Debian
and select
Test java provider to confirm Sun Java6 JDK is installed
sudo aptitude install sun-java6-jdk
Set java provider in Debian
sudo update-alternatives --config java
and select
/usr/lib/jvm/java-6-sun/jre/bin/java
Test java provider to confirm Sun Java6 JDK is installed
java -version
星期六, 2月 13, 2010
Install Virtualbox-3.1 on Debian
1. prepare the environment for build kernel module of virtualbox
2. add repository of virtualbox for debian lenny
3. get the Sun public key for apt-secure
4. add the public key into apt
5. update the apt repository
6. install the virtualbox
sudo aptitude install module-assistant dkms
sudo m-a prepare
2. add repository of virtualbox for debian lenny
deb http://download.virtualbox.org/virtualbox/debian lenny non-free
3. get the Sun public key for apt-secure
wget http://download.virtualbox.org/virtualbox/debian/sun_ vbox.asc
4. add the public key into apt
sudo apt-key add sun_vbox.asc
5. update the apt repository
sudo aptitude update
6. install the virtualbox
sudo aptitude install virtualbox-3.1
星期四, 10月 29, 2009
Running Wireshark as a non root user
在 Ubuntu 中以一般使用者身份執行 Wireshark 無法選擇網路界面
解決方法:
設定網路特權給 dumpcap
1. 確定 linux kernel 及檔案系統支援 File Capabilities
linux kernel 2.6.24 之後已完整支援 Capabilities
2.安裝 libcap2-bin
sudo aptitude install libcap2-bin
2. 以 setcap 為 dumpcap 設定網路特權
sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap
3. 以一般使用者啟動 Wireshark,看是否有網路界面供選擇了
參考資料:
http://wiki.wireshark.org/CaptureSetup/CapturePrivileges
星期二, 8月 25, 2009
switch nano to vim
Debian 預設的 editor 是 nano,對習慣使用 vim 的人是很不方便的。
例如,以 visudo 來修改 /etc/sudoers 時是用 nano 打開的。
我們可以用下面的方式將之換成以 vi 來開啟
這時會列出好數個可以提供 editor 的程式,選 vim 即可。
例如,以 visudo 來修改 /etc/sudoers 時是用 nano 打開的。
我們可以用下面的方式將之換成以 vi 來開啟
sudo update-alternatives --config editor
這時會列出好數個可以提供 editor 的程式,選 vim 即可。
sudo
Debian 預設是沒有啟用 sudo,並且也沒有將安裝過程中所建立的一般使用者帳號加入 sudo 群組。已有人向 Debian installer team 提出需求了,希望未來安裝完後就順便做完這件事。(Ubuntu 預設是會這麼做的)
接下來說明怎麼啟用 sudo,並將需要用到 root 權力的一般使用者加入 sudo 群組。
1. 變身為 SuperUser
將之註解移去
按下 + o 將結果儲存
要寫入的檔案名稱 : /etc/sudoers.tmp 按下 enter 即可
接著按下 + x 離開編輯器
3. 將自己(username)加入 sudo 群組
接下來 username 這個使用者就可以用 sudo 了。
接下來說明怎麼啟用 sudo,並將需要用到 root 權力的一般使用者加入 sudo 群組。
1. 變身為 SuperUser
$ su -2. 編輯 /etc/sudoers (下面的指令會以預設的編輯器打開 /etc/sudoers)
# visudo找到下面這行
# sudo ALL=NOPASSWD: ALL
將之註解移去
sudo ALL=NOPASSWD: ALL
按下
要寫入的檔案名稱 : /etc/sudoers.tmp 按下 enter 即可
接著按下
3. 將自己(username)加入 sudo 群組
# adduser username sudo
接下來 username 這個使用者就可以用 sudo 了。
星期四, 7月 02, 2009
VirtualBox USB not working on Debian lenny
引用來源:
http://forums.virtualbox.org/viewtopic.php?f=7&t=18934#p81634
Debian Lenny sets up /proc/bus/usb and /dev/bus/usb as root:root without write permissions.
So, I needed to dig and find this:
/etc/init.d/mountkernfs.sh
I edited that file. The line in question (line 75) as supplied by Debian:
This needed to be changed to:
Group ID 46 is "plugdev" for my system, and it makes sense to me to have that group given write permissions to the USB devices, since that group allows one to mount and use removable (usually USB) media. devmode=0664 just adds +w to the owner and group - which is required in addition to just changing the group itself.
I needed to reboot to activate this, since it's not a normal init script.
http://forums.virtualbox.org/viewtopic.php?f=7&t=18934#p81634
Re: USB not working (with PUEL)
by draeath » 20. Jun 2009, 04:01
Debian Lenny sets up /proc/bus/usb and /dev/bus/usb as root:root without write permissions.
So, I needed to dig and find this:
/etc/init.d/mountkernfs.sh
I edited that file. The line in question (line 75) as supplied by Debian:
domount usbfs usbdevfs /proc/bus/usb usbfs -onodev,noexec,nosuid
This needed to be changed to:
domount usbfs usbdevfs /proc/bus/usb usbfs -onodev,noexec,nosuid,devmode=0664,devgid=46
Group ID 46 is "plugdev" for my system, and it makes sense to me to have that group given write permissions to the USB devices, since that group allows one to mount and use removable (usually USB) media. devmode=0664 just adds +w to the owner and group - which is required in addition to just changing the group itself.
I needed to reboot to activate this, since it's not a normal init script.
星期二, 3月 17, 2009
星期四, 10月 30, 2008
debian backports
為了不想常常收到新套件更新的通知,所以用的是 stable (etch) 的套件庫。但有時會需要用到較新版本的套件,這時怎麼辦呢?Debian 提供了一個 backports 的套件庫用來解決這個問題。
backports 會收錄重新編譯過的 testing 及 unstable 的套件。
使用方法如下:
在 /etc/apt/sources.list 加入
deb http://www.backports.org/debian etch-backports main contrib non-free
使用 aptitude 時指定 -t etch-backports,如
sudo aptitude -t etch-backports search xxx
sudo aptitude -t etch-backports install xxx
backports 會收錄重新編譯過的 testing 及 unstable 的套件。
使用方法如下:
在 /etc/apt/sources.list 加入
deb http://www.backports.org/debian etch-backports main contrib non-free
使用 aptitude 時指定 -t etch-backports,如
sudo aptitude -t etch-backports search xxx
sudo aptitude -t etch-backports install xxx
星期二, 7月 22, 2008
visudo 的 editor
在 debian lenny 執行 visudo 時,會以 nano 作為編輯器。
若要改以 vim 開啟,可以這樣做
update-alternatives --config editor
再選成 vim 即可。
若要改以 vim 開啟,可以這樣做
update-alternatives --config editor
再選成 vim 即可。
星期三, 5月 28, 2008
[轉貼]debian switch version of program
原文出處:
http://descent-incoming.blogspot.com/2008/03/debianubuntu-update-alternatives.html
在 unix 的世界裡, 同樣功能的程式有很多的版本。
以 awk 來說, 就有 gawk, mawk ...
vi 有, vim, vim-tiny ...
或不同程式有不同版本,
例如 gcc 2.95, gcc 3.3, gcc 3.4, gcc 4.1 ...
debian 提供一個指令可以方便切換使用不同版本的程式。
update-alternatives
以 gcc 來舉例。目前系統有 gcc 3.3, gcc 2.95 兩個版本。
這樣會使得 gcc 可以分別設定為 /usr/bin/gcc-3.3 或是
/usr/bin/gcc-2.95
則是用來移除該版本的命令。
There are 2 alternatives which provide `gcc'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/gcc-2.95
*+ 2 /usr/bin/gcc-3.3
就可以選擇 gcc 這個 symblic link 使用 /usr/bin/gcc-2.95, 或是
/usr/bin/gcc-2.95
可以方便使用不同版本的程式。
這是 debian 提供的, 其他套件不知有無提供類似的方式。
http://descent-incoming.blogspot.com/2008/03/debianubuntu-update-alternatives.html
在 unix 的世界裡, 同樣功能的程式有很多的版本。
以 awk 來說, 就有 gawk, mawk ...
vi 有, vim, vim-tiny ...
或不同程式有不同版本,
例如 gcc 2.95, gcc 3.3, gcc 3.4, gcc 4.1 ...
debian 提供一個指令可以方便切換使用不同版本的程式。
update-alternatives
以 gcc 來舉例。目前系統有 gcc 3.3, gcc 2.95 兩個版本。
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.3 52
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-2.95 53
這樣會使得 gcc 可以分別設定為 /usr/bin/gcc-3.3 或是
/usr/bin/gcc-2.95
update-alternatives --remove gcc /usr/bin/gcc-3.4
則是用來移除該版本的命令。
update-alternatives --config gcc
There are 2 alternatives which provide `gcc'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/gcc-2.95
*+ 2 /usr/bin/gcc-3.3
就可以選擇 gcc 這個 symblic link 使用 /usr/bin/gcc-2.95, 或是
/usr/bin/gcc-2.95
可以方便使用不同版本的程式。
這是 debian 提供的, 其他套件不知有無提供類似的方式。
星期五, 3月 28, 2008
安裝 Wine
以下參考自 WineHQ Howto
安裝 Wine for for Ubuntu, Debian, and Debian-based 的套件
加入 WineHQ APT 檔案庫
首先,加入 WineHQ 檔案庫的 key 到系統,使系統信任來自 WineHQ 的檔案
For Debian Etch (4.0):
安裝 Wine
設定 wine
以 wine 執行 win32 程式
安裝 Wine for for Ubuntu, Debian, and Debian-based 的套件
加入 WineHQ APT 檔案庫
首先,加入 WineHQ 檔案庫的 key 到系統,使系統信任來自 WineHQ 的檔案
$ wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
For Debian Etch (4.0):
$ sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/etch.list -O /etc/apt/sources.list.d/winehq.list
安裝 Wine
$ sudo aptitude update
$ sudo aptitude install wine
設定 wine
$ winecfg
以 wine 執行 win32 程式
$ wine win32app
星期二, 3月 11, 2008
快速建立 chroot 環境
首先建立一個資料夾
接著使用 debootstrap 建立 chroot 環境
若需透過 proxy 則使用
建立一個 chroot.sh ,方便執行 chroot
接下來就可以使用這個環境了
修改環境,讓用起來好看些
編輯 /etc/debian_chroot,加入一個字串或符號,可以讓我們在進入 chroot 環境後,提示我們目前是在 chroot 環境。例如加入 CHROOT,則重進一次 chroot 後,會變成
為提示符號加入彩色控制碼,編輯 /etc/bash.bashrc,修改 PS1變數如下,此修改尚需配合下面的 /root/.bashrc 的修改方能生效。
編輯/root/.bashrc
將 PS1 變數註解起來,使上個步驟所修改的 PS1 變數不會被蓋掉
將 LS_OPTIONS 相關的變數打開,使 ls 可以顯示色彩
修改 /etc/apt/sources.list,設定為 Taiwan 的套件供應站
安裝編譯程式所需的一些套件
完工!!!
2008/03/24 補充
chroot 裡的時間會跟目前時間差八小時,看起來是 time zone 沒有設定
執行
設定到 Asia/Taipei 就解決了!
2010/12/08 補充
Debian / Lenny 之後 tzconfig 改為 tzdata
2012/04/13 update to Debian/Wheezy
預設的 sh 是使用 dash ,將之改為 bash
$ mkdir wheezy32
接著使用 debootstrap 建立 chroot 環境
# debootstrap --arch i386 wheezy ./wheezy32 \
http://free.nchc.org.tw/debian
若需透過 proxy 則使用
# http_proxy=http://user:password@proxy.server:port/ \
debootstrap --arch i386 wheezy ./wheezy32 \
http://free.nchc.org.tw/debian
建立一個 chroot.sh ,方便執行 chroot
#!/bin/bash
CHROOT_DIR=`pwd`/$1
# check if it was already mounted
MOUNT_PROC_TMP=`mount | grep ${CHROOT_DIR} | grep proc | cut -d' ' -f3`
# umount previus mounted staff
if [ $# -eq 1 ]; then
if [ $1 = "clean" ]; then
umount ${CHROOT_DIR}/proc
umount ${CHROOT_DIR}/tmp
umount ${CHROOT_DIR}/dev/pts
exit 0
fi
fi
if [ -z $MOUNT_PROC_TMP ]; then
mount --bind /proc ${CHROOT_DIR}/proc
mount --bind /tmp ${CHROOT_DIR}/tmp
mount --bind /dev/pts ${CHROOT_DIR}/dev/pts
fi
/usr/sbin/chroot ${CHROOT_DIR} /usr/bin/env -i HOME=/root TERM=$TERM PATH=/bin:/usr/bin:/sbin:/usr/sbin SHELL=/bin/bash /bin/bash
接下來就可以使用這個環境了
$ sudo chroot.sh wheezy32
root@:/#
修改環境,讓用起來好看些
編輯 /etc/debian_chroot,加入一個字串或符號,可以讓我們在進入 chroot 環境後,提示我們目前是在 chroot 環境。例如加入 CHROOT,則重進一次 chroot 後,會變成
root@CHROOT:/#
為提示符號加入彩色控制碼,編輯 /etc/bash.bashrc,修改 PS1變數如下,此修改尚需配合下面的 /root/.bashrc 的修改方能生效。
PS1='\[\033[01;32m\]\u@${debian_chroot}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
編輯/root/.bashrc
將 PS1 變數註解起來,使上個步驟所修改的 PS1 變數不會被蓋掉
將 LS_OPTIONS 相關的變數打開,使 ls 可以顯示色彩
# export PS1...
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
修改 /etc/apt/sources.list,設定為 Taiwan 的套件供應站
deb http://free.nchc.org.tw/debian wheezy main non-free contrib
安裝編譯程式所需的一些套件
root@CHROOT:/# aptitude update
root@CHROOT:/# aptitude install build-essential vim ncurses-dev enca locales zlib1g-dev bison flex gawk pkg-config file less tree libgmp-dev libmpfr-dev libmpc-dev
完工!!!
2008/03/24 補充
chroot 裡的時間會跟目前時間差八小時,看起來是 time zone 沒有設定
執行
# dpkg-reconfigure tzconfig
設定到 Asia/Taipei 就解決了!
2010/12/08 補充
Debian / Lenny 之後 tzconfig 改為 tzdata
# dpkg-reconfigure tzdata2012/03/9 update to Debian/Squeeze
2012/04/13 update to Debian/Wheezy
預設的 sh 是使用 dash ,將之改為 bash
# dpkg-reconfigure dash
星期三, 1月 09, 2008
Debian set up a bridge
My setting of /etc/network/interfaces
==================================
allow-auto lo br0 br1
allow-hotplug br0 br1
iface lo inet loopback
# The primary network interface
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
tunctl_user richman
iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
iface br0 inet static
address 192.168.2.248
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
bridge_ports eth0 tap0
bridge_maxwait 0
gateway 192.168.2.2
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.2.2
iface tap1 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
tunctl_user richman
iface eth1 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
iface br1 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
bridge_ports eth1 tap1
bridge_maxwait 0
==================================
allow-auto lo br0 br1
allow-hotplug br0 br1
iface lo inet loopback
# The primary network interface
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
tunctl_user richman
iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
iface br0 inet static
address 192.168.2.248
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
bridge_ports eth0 tap0
bridge_maxwait 0
gateway 192.168.2.2
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.2.2
iface tap1 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
tunctl_user richman
iface eth1 inet manual
up ifconfig $IFACE 0.0.0.0 promisc
down ifconfig $IFACE down
iface br1 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
bridge_ports eth1 tap1
bridge_maxwait 0
訂閱:
文章 (Atom)