這裏顯示兩個版本的差異處。
| Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
|
linux:debian [2007/08/22 14:43] wenpei |
linux:debian [2009/09/13 22:31] (目前版本) wenpei |
||
|---|---|---|---|
| 行 32: | 行 32: | ||
| 查詢某個檔案是哪個套件提供的 | 查詢某個檔案是哪個套件提供的 | ||
| $ dpkg -S [檔案名] | $ dpkg -S [檔案名] | ||
| + | |||
| + | ===== Reference ===== | ||
| + | DPKG/APT 常用指令 (上):http://tetralet.luna.com.tw/index.php?op=ViewArticle&articleId=219&blogId=1 | ||
| + | |||
| + | DPKG/APT 常用指令 (下):http://tetralet.luna.com.tw/index.php?op=ViewArticle&articleId=220&blogId=1 | ||
| ====== 自己修改 deb 檔案的相依性資訊 ====== | ====== 自己修改 deb 檔案的相依性資訊 ====== | ||
| 行 41: | 行 46: | ||
| $ ar r file.deb control.tar.gz | $ ar r file.deb control.tar.gz | ||
| 將新的 control 加進去即可。 | 將新的 control 加進去即可。 | ||
| + | |||
| + | ====== apt-build ====== | ||
| + | 重新編譯套件,建立最佳化套件。 | ||
| + | # apt-get install apt-build | ||
| + | 設定檔放在 /etc/apt/apt-build.conf,接著更新套件清單 | ||
| + | # apt-build update | ||
| + | |||
| + | 安裝套件 | ||
| + | # apt-build install [套件名] | ||
| + | 如果要重新安裝套件 | ||
| + | # apt-build --reinstall install [套件名] | ||
| + | |||
| + | 相關檔案放在 /var/cache/apt-build 中。 | ||
| + | |||
| + | ===== 將系統中所有套件重新編譯最佳化 ===== | ||
| + | 首先將系統內所有已經安裝的套件列出來 | ||
| + | # dpkg --get-selections | awk '{if ($2 == "install") print $1}' > /etc/apt/apt-build.list | ||
| + | |||
| + | 全系統編譯,需要非常久的時間 | ||
| + | # 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://www.in-life.idv.tw/index.php?/archives/374-c-checkinstall-ae-make-install.html | http://www.in-life.idv.tw/index.php?/archives/374-c-checkinstall-ae-make-install.html | ||
| + | |||
| + | ====== 編譯核心 ====== | ||
| + | 安裝所需套件 | ||
| + | apt-get install libncurses5-dev kernel-package linux-source | ||
| + | |||
| + | 到 /usr/src 將下載下來的 tar.bz2 檔案解壓縮,然後將 /boot/config-x.x.xx-xxx 這個設定檔複製到解開的目錄下,並更名成 .config。 | ||
| + | |||
| + | make-kpkg clean | ||
| + | |||
| + | 修改設定檔 | ||
| + | make menuconfig | ||
| + | |||
| + | 將核心編譯成 dpkg 檔 | ||
| + | make-kpkg --revision xxx.xxx --config=menuconfig --initrd binary-arch | ||
| + | |||
| + | 完成後將會產生兩個 deb 檔案,利用 dpkg -i 將這兩個套件安裝即可。 | ||
| + | |||
| + | ====== 套件損毀 ====== | ||
| + | 如果不小心安裝到 ubuntu 的 .deb 套件,有可能安裝失敗,導致要重新安裝、移除都不行,出現下列資訊: | ||
| + | |||
| + | 中文: | ||
| + | <code> | ||
| + | dpkg:在處理 adobe-flashplugin (--remove) 時發生錯誤: | ||
| + | 該套件正處於極度混亂的狀態 - 您最好能在移除它之前先重新安裝一次。 | ||
| + | 在處理時有錯誤發生: | ||
| + | adobe-flashplugin | ||
| + | E: Sub-process /usr/bin/dpkg returned an error code (1) | ||
| + | 套件安裝失敗。正在試圖恢復: | ||
| + | </code> | ||
| + | |||
| + | 英文: | ||
| + | <code> | ||
| + | dpkg: error processing adobe-flashplugin (--remove): | ||
| + | Package is in a very bad inconsistent state - you should | ||
| + | reinstall it before attempting a removal. | ||
| + | Errors were encountered while processing: | ||
| + | adobe-flashplugin | ||
| + | E: Sub-process /usr/bin/dpkg returned an error code (1) | ||
| + | A package failed to install. Trying to recover: | ||
| + | </code> | ||
| + | |||
| + | 處理方式: | ||
| + | - 備份 /var/lib/dpkg/status 檔案 | ||
| + | - 編輯上述檔案,找到套件名稱,如本例的 adobe-flashplugin | ||
| + | - 將所有相關資訊(一整個區塊)刪除,存檔離開即可 | ||
| + | <code> | ||
| + | Package: adobe-flashplugin | ||
| + | Status: deinstall reinstreq half-configured | ||
| + | Priority: optional | ||
| + | Section: web | ||
| + | Installed-Size: 9976 | ||
| + | Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com> | ||
| + | Architecture: i386 | ||
| + | Version: 10.0.22.87-1 | ||
| + | Config-Version: 10.0.22.87-1 | ||
| + | Replaces: flashplugin (<< 6) | ||
| + | Provides: flashplugin-nonfree | ||
| + | Depends: debconf | debconf-2.0, fontconfig, libatk1.0-0 (>= 1.20.0), libc6 (>= 2.4), libcairo2 (>= 1.6.0), libcurl3, libfontconfig1 (>= 2.4.0), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.1.1-21), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.12.0), libnspr4-0d, libnss3-1d, libpango1.0-0 (>= 1.20.5), libstdc++6 (>= 4.1.1-21), libx11-6, libxext6, libxt6, wget | ||
| + | Suggests: firefox, konqueror-nsplugins, msttcorefonts, ttf-bitstream-vera | ttf-dejavu, ttf-xfree86-nonfree, x-ttcidfont-conf, xfs (>= 1:1.0.1-5) | ||
| + | Conflicts: flashplayer-mozilla, flashplugin (<< 6), xfs (<< 1:1.0.1-5) | ||
| + | Description: Adobe Flash Player plugin version 10 | ||
| + | This package will download the Flash Player from Adobe. It is a | ||
| + | Netscape/Mozilla type plugin. Any browser based on Netscape or Mozilla can use | ||
| + | the Flash plugin. This package officially supports the following browsers: | ||
| + | . | ||
| + | Firefox 2.x, Firefox 3.x, SeaMonkey 1.11 | ||
| + | Original-Maintainer: DL-Flash Player Ubuntu <FlashPlayerUbuntu@adobe.com> | ||
| + | </code> | ||
| ====== useful ubuntu links ====== | ====== useful ubuntu links ====== | ||