Debian 套件 安裝
1.
pi@raspberrypi ~ $ dpkg --help
用法:dpkg [<;選項> ...] <命令>指令:
-i|--install <;.deb 檔> ... | -R|--recursive <目錄> ... --unpack <;.deb 檔> ... | -R|--recursive <目錄> ... -A|--record-avail <;.deb 檔> ... | -R|--recursive <目錄> ... --configure <;套件> ... | -a|--pending --triggers-only <;套件> ... | -a|--pending -r|--remove <;套件> ... | -a|--pending -P|--purge <;套件> ... | -a|--pending --get-selections [<;表達式> ...] 將選擇清單,列印到標準輸出。--set-selections 從標準輸入,取得套件選擇清單。
--clear-selections 取消所有的非核心套件。
--update-avail <;Packages 檔> 取代可用套件資訊。 --merge-avail <;Packages 檔> 由檔案合併可用套件資訊。--clear-avail 清除可用套件資訊。
--forget-old-unavail 清除已移除且無法再安裝的套件。
-s|--status <;套件> ... 顯示套件詳情。 -p|--print-avail <;套件> ... 顯示可用版本詳情。 -L|--listfiles <;套件> ... 列出 `屬於' 套件的檔案。 -l|--list [<;表達式> ...] 簡要列出套件。 -S|--search <;表達式> ... 搜尋擁有該檔案的套件。-C|--audit 檢查有沒有損毀的套件。
--add-architecture <;硬體平台> 把 <硬體平台> 加到硬體平台清單中。 --remove-architecture <;硬體平台> 由硬體平台清單移除 <硬體平台>。--print-architecture 顯示 dpkg 的硬體平台。
--print-foreign-architectures 顯示可用的異質硬體平台。
--compare-versions <;a> <op> <b> 比較版本 - 請參閱下文。--force-help 顯示強制選項的說明。
-Dh|--debug=help 顯示偵錯模式的說明。
-?, --help 顯示這個說明訊息。
--version 顯示版本資訊。
使用 dpkg -b|--build|-c|--contents|-e|--control|-I|--info|-f|--field|
-x|--extract|-X|--vextract|--fsys-tarfile 於套件檔上(鍵入 dpkg-deb --help)。
內部使用:dpkg --assert-support-predepends | --predep-package |
--assert-working-epoch | --assert-long-filenames | --assert-multi-conrep |
--assert-multi-arch。
選項:
--admindir=<;目錄> 使用 <目錄> 代替 /var/lib/dpkg。 --root=<;目錄> 安裝在另一個 root 目錄。 --instdir=<;目錄> 變更安裝路徑,不變更 admin dir。 --path-exclude=<;表達式> 不安裝符合 shell 表達式的檔案。 --path-include=<;表達式> 前項選項排除後,再加上符合表達式的檔案。-O|--selected-only 略過未選擇為要安裝/升級的套件。
-E|--skip-same-version 略過相同版本已安裝的套件。
-G|--refuse-downgrade 略過比已安裝版本舊的套件。
-B|--auto-deconfigure 即使會損毀其它套件也要安裝。
--[no-]triggers 略過或強制接下來的觸發程式。
--no-debsig 不試著去驗証套件簽章。
--no-act|--dry-run|--simulate
只顯示接下來的動作 - 不實際執行。
-D|--debug=<;八進制數字> 啟用除錯(參閱 -Dhelp 或 --debug=help)。 --status-fd <;n> 傳送狀態異動至檔案敘述 <n>。 --status-logger=<;指令> 傳送狀態異動 <指令> 的標準輸入。 --log=<;檔名> 記錄狀態異動及動作至 <檔名>。 --ignore-depends=<;套件>,... 忽略 <;套件> 的相依關係。--force-... 無視問題(參閱 --force-help)。
--no-force-...|--refuse-...
當發生問題時中止。
--abort-after <;n> 碰到 <n> 個錯誤後中止。--compare-versions 的比較運算子:
lt le eq ne ge gt (無版號時,視為最舊版);
lt-nl le-nl ge-nl gt-nl (無版號時,視為最新版);
<; << <= = >= >> > (相容於控制檔的語法專用)。使用 `dselect' 或 `aptitude' 等介面親和的套件管理程式。
2. man dpkg
以zsh 為例.
A.是否已被安裝 dpgk –l
$dpkg -l zsh
B.若在A中,"no packages found matching zsh"則去檢查是否可在套件中找到
sudo apt-cache serach zsh
zsh - A shell with lots of featureszsh-dbg - A shell with lots of features (debugging symbols)zsh-dev - A shell with lots of features (development files)zsh-doc - zsh documentation - info/HTML format
csh - Shell with C-like syntax, standard login shell on BSD systemsdraai - A command-line music player for MPDfatrat-czshare - fatrat plugin allowing download and upload to czsharegrml-shlib - Generic shell library used in grml scriptstucan - Download and upload manager for 1-Click Hostersviewglob - A graphical display of directories referenced at the shell prompt
zsh-beta - A shell with lots of features (dev tree)zsh-beta-doc - zsh beta documentation - info/HTML format
zsh-lovers - tips, tricks and examples for the zshzsh-static - A shell with lots of features (static link)zshdb - debugger for Z-Shell scriptsC. 若有找到時,則可以使用APT安裝
apt-get install zsh
D.檢查其zsh是否已正確安裝
dpkg -s zsh
Package: zsh
Status: install ok installed
Priority: optional
Section: shells
Installed-Size: 13732
Maintainer: Ubuntu Developers (ubuntu-devel-discuss@lists.ubuntu.com)
Architecture: amd64
Version: 4.3.11-4ubuntu2.is.3ubuntu1
Depends: libc6 (>;= 2.4), libcap2 (>= 2.10), libncursesw5 (>= 5.6+20070908)Recommends: libc6 (>;= 2.11), libpcre3 (>= 8.10)Suggests: zsh-doc
Conffiles:
/etc/zsh/zlogin 48032df2ace0977f2491b016e3c421a3
/etc/zsh/zlogout b73789c3e790b855302ce10ca076037a
/etc/zsh/zprofile 58c4f65d775c055b5d80b67c1bd12838
/etc/zsh/zshenv 5a8a0ff4f6ff945a5aa6ba7f6f1e8c97
/etc/zsh/zshrc e069ba51ba293da1aeddd5779324df19
/etc/zsh/newuser.zshrc.recommended dac3563a2ddd13e8027b1861d415f3d4
Description: A shell with lots of featuresZsh is a UNIX command interpreter (shell) usable as an
interactive login shell and as a shell script command
processor. Of the standard shells, zsh most closely resembles
ksh but includes many enhancements. Zsh has command-line editing,
built-in spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and ahost of other features.
Homepage: http://www.zsh.org/
Original-Maintainer: Debian Zsh Maintainers (pkg-zsh-devel@lists.alioth.debian.org)
E.列出相關文件 (可以去找出confi)
dpkg -L zsh
F.
apt-get remove zsh
sudo dpkg -P(R) zsh
#P : remove all soft and config
#R : remain config
实践:Debian 软件包管理
http://www.ibm.com/developerworks/cn/linux/l-setup-debpkg-pr/index.html