linux:debian
差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版前次修改 下次修改 | 前次修改 | ||
| linux:debian [2007/05/03 01:38] – wenpei | linux:debian [2009/09/13 22:31] (目前版本) – wenpei | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== dpkg ====== | ||
| + | 查詢套件詳細資料 | ||
| + | $ dpkg -s [套件名] | ||
| + | |||
| + | 列出所有已經安裝的套件 | ||
| + | $ dpkg -l | ||
| + | |||
| + | 查詢指定套件狀態 | ||
| + | $ dpkg -l [套件名] | ||
| + | |||
| + | 第一位為期望碼,第二位為目前狀態碼。 | ||
| + | ^ 符號 | ||
| + | | u |未知| | ||
| + | | i |安裝| | ||
| + | | r |刪除| | ||
| + | | p |清除| | ||
| + | | h |凍結| | ||
| + | ^ 符號 | ||
| + | | n |無| | ||
| + | | i |已安裝| | ||
| + | | c |僅存設定檔| | ||
| + | | U |僅解壓縮| | ||
| + | | F |設定失敗| | ||
| + | | H |不完全安裝| | ||
| + | |||
| + | 查詢套件包含的所有檔案 | ||
| + | $ dpkg -L [套件名] | ||
| + | |||
| + | 查詢 .deb 檔案中包含的檔案 | ||
| + | $ dpkg -c [*.deb] | ||
| + | |||
| + | 查詢某個檔案是哪個套件提供的 | ||
| + | $ dpkg -S [檔案名] | ||
| + | |||
| + | ===== Reference ===== | ||
| + | DPKG/APT 常用指令 (上):http:// | ||
| + | |||
| + | DPKG/APT 常用指令 (下):http:// | ||
| + | |||
| + | ====== 自己修改 deb 檔案的相依性資訊 ====== | ||
| + | 拿到一個 deb 檔,用 ar 解開 | ||
| + | $ ar x file.deb | ||
| + | 得到 debian-binary、control.tar.gz、data.tar.gz 三個檔案,再把 control.tar.gz 解開,得到 control 檔,裡面紀錄套件資訊,修改好 Depends 後,將 control.tar.gz 包回去,然後用 | ||
| + | $ ar d file.deb control.tar.gz | ||
| + | 將舊的 control 刪除,最後用 | ||
| + | $ ar r file.deb control.tar.gz | ||
| + | 將新的 control 加進去即可。 | ||
| + | |||
| + | ====== apt-build ====== | ||
| + | 重新編譯套件,建立最佳化套件。 | ||
| + | # apt-get install apt-build | ||
| + | 設定檔放在 / | ||
| + | # apt-build update | ||
| + | |||
| + | 安裝套件 | ||
| + | # apt-build install [套件名] | ||
| + | 如果要重新安裝套件 | ||
| + | # apt-build --reinstall install [套件名] | ||
| + | |||
| + | 相關檔案放在 / | ||
| + | |||
| + | ===== 將系統中所有套件重新編譯最佳化 ===== | ||
| + | 首先將系統內所有已經安裝的套件列出來 | ||
| + | # dpkg --get-selections | awk '{if ($2 == " | ||
| + | |||
| + | 全系統編譯,需要非常久的時間 | ||
| + | # apt-build world | ||
| + | |||
| + | ====== auto-apt ====== | ||
| + | 如果套件沒有 debianize,要手動用 tarball 編譯,而 configure 時會因相依性不足,需要手動安裝許多套件,auto-apt 即可自動安裝相依套件,先安裝 auto-apt,然後更新清單 | ||
| + | # auto-apt update | ||
| + | |||
| + | 接著 configure 套件,若遇到缺少的套件,會另外跳出一個視窗詢問是否要安裝套件。 | ||
| + | # auto-apt run ./configure | ||
| + | # make | ||
| + | # make install | ||
| + | |||
| ====== 用 checkinstall 替代 make install ====== | ====== 用 checkinstall 替代 make install ====== | ||
| http:// | http:// | ||
| + | |||
| + | ====== 編譯核心 ====== | ||
| + | 安裝所需套件 | ||
| + | apt-get install libncurses5-dev kernel-package linux-source | ||
| + | |||
| + | 到 /usr/src 將下載下來的 tar.bz2 檔案解壓縮,然後將 / | ||
| + | |||
| + | make-kpkg clean | ||
| + | |||
| + | 修改設定檔 | ||
| + | make menuconfig | ||
| + | |||
| + | 將核心編譯成 dpkg 檔 | ||
| + | make-kpkg --revision xxx.xxx --config=menuconfig --initrd binary-arch | ||
| + | |||
| + | 完成後將會產生兩個 deb 檔案,利用 dpkg -i 將這兩個套件安裝即可。 | ||
| + | |||
| + | ====== 套件損毀 ====== | ||
| + | 如果不小心安裝到 ubuntu 的 .deb 套件,有可能安裝失敗,導致要重新安裝、移除都不行,出現下列資訊: | ||
| + | |||
| + | 中文: | ||
| + | < | ||
| + | dpkg:在處理 adobe-flashplugin (--remove) 時發生錯誤: | ||
| + | | ||
| + | 在處理時有錯誤發生: | ||
| + | | ||
| + | E: Sub-process / | ||
| + | 套件安裝失敗。正在試圖恢復: | ||
| + | </ | ||
| + | |||
| + | 英文: | ||
| + | < | ||
| + | dpkg: error processing adobe-flashplugin (--remove): | ||
| + | | ||
| + | | ||
| + | Errors were encountered while processing: | ||
| + | | ||
| + | E: Sub-process / | ||
| + | A package failed to install. | ||
| + | </ | ||
| + | |||
| + | 處理方式: | ||
| + | - 備份 / | ||
| + | - 編輯上述檔案,找到套件名稱,如本例的 adobe-flashplugin | ||
| + | - 將所有相關資訊(一整個區塊)刪除,存檔離開即可 | ||
| + | < | ||
| + | Package: adobe-flashplugin | ||
| + | Status: deinstall reinstreq half-configured | ||
| + | Priority: optional | ||
| + | Section: web | ||
| + | Installed-Size: | ||
| + | Maintainer: Ubuntu Core Developers < | ||
| + | Architecture: | ||
| + | Version: 10.0.22.87-1 | ||
| + | Config-Version: | ||
| + | Replaces: flashplugin (<< 6) | ||
| + | Provides: flashplugin-nonfree | ||
| + | Depends: debconf | debconf-2.0, | ||
| + | Suggests: firefox, konqueror-nsplugins, | ||
| + | Conflicts: flashplayer-mozilla, | ||
| + | Description: | ||
| + | This package will download the Flash Player from Adobe. It is a | ||
| + | | ||
| + | the Flash plugin. This package officially supports the following browsers: | ||
| + | . | ||
| + | | ||
| + | Original-Maintainer: | ||
| + | </ | ||
| ====== useful ubuntu links ====== | ====== useful ubuntu links ====== | ||
| http:// | http:// | ||
| + | ====== How to install ANYTHING in Ubuntu! ====== | ||
| + | http:// | ||
| + | |||
| + | ====== Top 10 Ubuntu apps and tweaks ====== | ||
| + | http:// | ||
| + | ====== | ||
| + | http:// | ||
linux/debian.1178127521.txt.gz · 上一次變更: (外部編輯)
