debian 7.4 安裝配置

來源:互聯網
上載者:User

改用debian差不多有半年了,之前一直用fedora,大概3年多,雖然軟體包都很新,總是不太穩定,有點軟體用著用著就自動結束了。

換了debain之後,這半年還真是一直沒啥問題,這裡總結了一些安裝配置方法,以後有的話再補充。

 

1. 安裝 deb 包

對於以前一直用yum的我來說,剛開始還真不會用。

dpkg -i package.deb

 

2. 安裝和配置 sudo

剛開始時,沒有sudo命令,而且安裝debian時設定的使用者也沒有 sudo 許可權。

root    ALL=(ALL:ALL) ALLwangyubin    ALL=(ALL:ALL) ALL   # 添加需要的使用者

 

3. 設定 sudo 不用密碼

 

以前fedora時習慣了不輸入密碼,所以在debian下也配置了一下

# User privilege specificationroot    ALL=(ALL:ALL) ALL#wangyubin    ALL=(ALL:ALL) ALL     <-- 這個是需要輸入密碼的wangyubin    ALL=NOPASSWD: ALL     <-- 這個是不需要輸入密碼的

 

4. 追加支援中文的 locales

我習慣用E文的系統,因為主要都是用命令列來操作,圖形介面用的不多,而E文輸入起來比較方便。

 

5. 音效卡驅動安裝

都已經debian7.4版了,沒想到預設居然沒有聲音。。。

tar -xjf alsa-driver-1.0.25.3584.gb044d.tar.bz2cd alsa-driver-1.0.25.3584.gb044d./configure --with-cards=hda-intel --with-card-options=allmake -j5make installls -al `locate snd-hda-intel.ko`alasmixter # 調整音量

補充: 我在AMD cpu的系統山還安裝了 sudo apt-get install esound 才可以調整音量

 

 

參考文章: http://blog.csdn.net/wangzhilife/article/details/7881722

安裝過程中可能會缺少一些包,

# 遇到 configure: error: required curses helper header not foundsudo apt-get install libncurses5-dev# 遇到 configure: error: panelw library not found ./configure --with-curses=ncurses# 遇到 /bin/bash: xmlto: command not found sudo apt-get install xmlto# 遇到mv: cannot stat `t-ja.gmo': No such file or directory./configure --disable-nls

 

6. 顯卡驅動 (ATI顯卡)

 

7. fcitx安裝

用習慣了fcitx。

# fcitxexport GTK_IM_MODULE=ximexport XMODIFIERS="@im=fcitx"export QT_IM_MODULE=xim

 

補充:還有一種配置方法。

touch /etc/X11/Xsession.d/95inputvim /etc/X11/Xsession.d/95input# 95input 中內容如下:export XMODIFIERS=@im=fcitxexport XIM=fcitxexport XIM_PROGRAM=fcitxexport GTK_IM_MODULE=fcitxexport QT_IM_MODULE=XIMfcitx

 

8. emacs 中使用 fcitx

安裝完後發現 emacs中居然調不出 fcitx。

 

9. ssh串連很慢

預設的 debian 在用 ssh 串連遠程機器的時候,總是要等一段時間才會提示輸入密碼,剛開始以為網速慢,後來發現區域網路中也會等一段時間才連上。

於是,上網找瞭解決方法:

# 找到 Host 那行, 改為如下形式:hosts: files dns [NOTFOUND=return]

 

10. 卸載ffmpeg及相關內容

項目中要用 ffmpeg,debian內建的那個太舊,於是想把內建的卸載掉再安裝新的

sudo apt-get remove ffmpeg libav-tools libavdevice53 libavfilter2 libopencv-core2.3 libopencv-imgproc2.3 libtbb2

 

11. 設定時區
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

12. python 安裝 PIL時, 沒有jpeg和zlib的支援

即使安裝了 zlib 和 libjpeg 的package之後, 安裝PIL仍然

-------------------------------------------------------------------- *** TKINTER support not available (Tcl/Tk 8.4 libraries needed) *** JPEG support not available *** ZLIB (PNG/ZIP) support not available *** FREETYPE2 support not available--------------------------------------------------------------------

把 pip install PIL 改成 pip install pillow 即可 (pillow庫也是圖形處理的庫)

 

13. 配置oracle java 環境

這是為了開發android。

cd /optsudo tar zxvf ~/tools/jdk-7u51-linux-x64.tar.gzsudo update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_51/bin/java 1sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_51/bin/javac 1sudo update-alternatives --set java /opt/jdk1.7.0_51/bin/javasudo update-alternatives --set javac /opt/jdk1.7.0_51/bin/javac

 

14. x86_64 架構的 debian 上配置 android 開發環境

需要配置 32bit 的環境

sudo dpkg --add-architecture i386sudo apt-get updatesudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386

 

15. x86_64 架構的 debian 上卸載 32bit 環境
sudo apt-get remove --purge `dpkg --get-selections | grep i386 | awk '{print $1}'`sudo dpkg --remove-architecture i386

 

16. 安裝 emacs24

debian7.4 stable版本的軟體為了穩定性都比較舊. 預設的emacs還是 v23的.

下面的方法是從源碼安裝最新的 emacs v24版

# 準備下載,編譯源碼的環境sudo apt-get install git-coresudo apt-get install libxaw7-dev libxpm-dev libpng12-dev libtiff5-dev libgif-dev libjpeg8-dev libgtk2.0-dev libncurses5-devsudo apt-get install autoconf automakesudo apt-get build-dep emacs# 下載源碼 (下面2個源, 先下載試試看, 然後選擇一個下載快的)git clone --depth 1 https://github.com/emacsmirror/emacs.gitgit clone --depth 1 git://git.sv.gnu.org/emacs.git# 開始編譯cd emacs./autogen.sh./configure --prefix=/opt/emacs24make# 安裝sudo make install

 

17. 多個git帳號時, ssh認證的設定

1. ssh預設的私人key 放在 ~/.ssh/id_rsa 檔案中

2. 產生第2個帳號時, 需要如下步驟:

  •    - ssh-keygen -t rsa -C wangyb@chujuexinxi.com
  •    - 需要輸入key的名稱, 不能用預設名稱了 比如: id_rsa_oschina
  •    - ssh-add id_rsa_oschina (臨時追加一個ssh key)

3. 永久配置多個 ssh key

host chujuexinxi.comuser gituserhostname chujuexinxi.comport 22identityfile ~/.ssh/id_rsa_chujuexinxi_githost gitcafe.comuser githostname gitcafe.comport 22identityfile ~/.ssh/id_rsa_gitcafehost oschina.netuser githostname git.oschina.netport 22identityfile ~/.ssh/id_rsa_oschina

 

18. jpg 檔案轉 pdf的工具
sudo apt-get install imagemagickconvert 01.jpg 01.pdf

 

19. 自動停止或者啟動服務
sudo apt-get install sysv-rc-confsudo sysv-rc-conf

 

20. debian 固定IP設定
auto lo eth0iface lo inet loopbackiface eth0 inet staticaddress 192.168.1.77netmask 255.255.255.0  gateway 192.168.1.1

設定IP後重啟網路

/etc/init.d/networking restart

 

21. debian 7 安裝wireshark

預設安裝好的 wireshark 只能用root使用者來執行,否則提示找不到 *interfaces*

# 安裝 wiresharksudo apt-get install wireshark# 建立 wireshark 組sudo groupadd wireshark# 將你的使用者名稱添加到 wireshark 組sudo usermod -a -G wireshark YOUR_USER_NAME# 將 dumpcap 的所屬組改為 wiresharksudo chgrp wireshark /usr/bin/dumpcap# 改變dumpcap的許可權, 讓wireshark 群組成員可以執行該程式sudo chmod 750 /usr/bin/dumpcap# 使用setcap擷取許可權sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap# 驗證改變sudo getcap /usr/bin/dumpcap

 

安裝設定完成後,需要登出使用者重新登入或者直接重啟系統。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.