一、portage樹簡介
Portage可能是Gentoo在軟件包管理方面最矚目的創新。它所具有的高度靈活性以及其他大量的特性,使其經常被認為是Linux中最好用的軟件包管理工具。
Portage完全用Python和Bash寫成。由於它們均為腳本語言,所以Portage對於用戶而言也就是完全可見的。
絕大部分用戶將通過emerge工具來使用Portage
二、emerge命令
emerge --sync 更新portage樹(快速增量)
emerge-webresync 自動將最新的Portage快照下載並安裝到系統中
emerge --search 關鍵字查找
emerge --searchdesc 查找關鍵字相關的軟件包
emerge --pretend 解決依賴問題(假裝已經安裝了某個依賴包,例如一個軟件pdf依賴於adobe軟件包可以:emerge --pretend adobe pdf)
emerge --fetchonly 只下載軟件包到本地並不安裝
emerge -vp 查找已安裝的軟件包
emerge --unmerge 移除軟件(刪除軟件,卸載軟件)
emerge --update --ask world 更新系統
emerge --update --deep world 更新系統中的每個軟件包
emerge --update --deep --newuse world 檢查USE 標記變動後,更新系統是否要安裝新的軟件包或者重新編譯現有的包
# emerge --update --deep --newuse world
# emerge --depclean
# revdep-rebuild移除孤立的軟件包
revdep-rebuild工具由gentoolkit包提供;使用前別忘了首先emerge它:
emerge gentoolkit
Portage關於被阻擋的包的警告(使用--pretend參數)
[blocks B ] mail-mta/ssmtp (is blocking mail-mta/postfix-2.2.2-r1)
Portage關於被阻擋的包的警告(不使用--pretend參數)
!!! Error: the mail-mta/postfix package conflicts with another package. !!! both can't be installed on the same system together. !!! Please use 'emerge --pretend' to determine blockers.
Portage關於被屏蔽的包的警告
!!! all ebuilds that could satisfy "bootsplash" have been masked.
Portage關於被屏蔽的包的警告——原因
!!! possible candidates are: - gnome-base/gnome-2.8.0_pre1 (masked by: ~x86 keyword ) - lm-sensors/lm-sensors-2.8.7 (masked by: -sparc keyword ) - sys-libs/glibc-2.3.4.20040808 (masked by: -* keyword ) - dev-util/cvsd-1.0.2 (masked by: missing keyword ) - games-fps/unreal-tournament-451 (masked by: package.mask ) - sys-libs/glibc-2.3.2-r11 (masked by: profile )
Portage關於依賴缺失的警告
emerge: there are no ebuilds to satisfy ">=sys-devel/gcc-3.4.2-r4". !!! Problem with ebuild sys-devel/gcc-3.4.2-r2 !!! Possibly a DEPEND/*DEPEND problem.
Portage對於意指不明的Ebuild名稱的警告
!!! The short ebuild name "aterm" is ambiguous. Please specify !!! one of the following fully-qualified ebuild names instead: dev-libs/aterm x11-terms/aterm
Portage關於循環依賴問題的警告
!!! Error: circular dependencies: ebuild / net-print/cups-1.1.15-r2 depends on ebuild / app-text/ghostscript-7.05.3-r1 ebuild / app-text/ghostscript-7.05.3-r1 depends on ebuild / net-print/cups-1.1.15-r2
Portage關於下載失敗的警告
!!! Fetch failed for sys-libs/ncurses-5.4-r5, continuing... (...) !!! Some fetch errors were encountered. Please see above for details.
Portage關於profile中保護的包的警告
!!! Trying to unmerge package(s) in system profile. 'sys-apps/portage' !!! This could be damaging to your system.
Digest驗證失敗
>>> checking ebuild checksums !!! Digest verification failed:
重要: 短時間內多次重複sync的portage樹(對於同一個rsync服務器)。正如(當您運行emerge --sync時)rsync策略所指出的那樣,那些短時間內過於頻繁進行多次sync的用戶將會被更新服務器禁止訪問(一般是將你的IP添加到禁止名單並保留一段指定的時間後才解除)。實際上,最好等到您的下次計劃更新的日子再sync,因為這樣您不會使rsync服務器過載而影響其他用戶的正常使用。
(筆記源於Gentoo linux 文檔http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml?part=2&chap=1)
請先 登入 以發表留言。