主機平台:Gentoo Linux 11.2
內核版本:Linux Kernel 3.2.1
我們都喜歡Gentoo下的軟件安裝,多虧了Portage的技術,高度定制,編譯安裝過程中基本不會出現依賴的錯誤,也不會存在源碼安裝情況下的版本問題。不過自己感覺如果從源中emerge安裝來一個軟件,它會自動解決依賴,也會裝一些其他的包,當我們將這個軟件卸載後,其他的軟件包貌似沒有完全刪除。
下面我就通過日志信息來還原安裝前的狀態。
首先查看日志,將/var/log/emerge.log下相應時間戳的內容復制到一個空白文件pack.log中。
形如:
- 1332998017: === (1 of 17) Cleaning (dev-libs/kpathsea-6.0.1_p20110705::/usr/portage/dev-libs/kpathsea/kpathsea-6.0.1_p20110705.ebuild)
- 1332998021: === (1 of 17) Compiling/Merging (dev-libs/kpathsea-6.0.1_p20110705::/usr/portage/dev-libs/kpathsea/kpathsea-6.0.1_p20110705.ebuild)
- 1332998097: === (1 of 17) Merging (dev-libs/kpathsea-6.0.1_p20110705::/usr/portage/dev-libs/kpathsea/kpathsea-6.0.1_p20110705.ebuild)
- 1332998099: >>> AUTOCLEAN: dev-libs/kpathsea:0
- 1332998106: === (1 of 17) Post-Build Cleaning (dev-libs/kpathsea-6.0.1_p20110705::/usr/portage/dev-libs/kpathsea/kpathsea-6.0.1_p20110705.ebuild)
- 1332998106: ::: completed emerge (1 of 17) dev-libs/kpathsea-6.0.1_p20110705 to /
- 1332998106: >>> emerge (2 of 17) dev-libs/zziplib-0.13.60-r1 to /
- 1332998106: === (2 of 17) Cleaning (dev-libs/zziplib-0.13.60-r1::/usr/portage/dev-libs/zziplib/zziplib-0.13.60-r1.ebuild)
- 1332998107: === (2 of 17) Compiling/Merging (dev-libs/zziplib-0.13.60-r1::/usr/portage/dev-libs/zziplib/zziplib-0.13.60-r1.ebuild)
- 1332998158: === (2 of 17) Merging (dev-libs/zziplib-0.13.60-r1::/usr/portage/dev-libs/zziplib/zziplib-0.13.60-r1.ebuild)
- 1332998159: >>> AUTOCLEAN: dev-libs/zziplib:0
- 1332998160: === (2 of 17) Post-Build Cleaning (dev-libs/zziplib-0.13.60-r1::/usr/portage/dev-libs/zziplib/zziplib-0.13.60-r1.ebuild)
- 1332998160: ::: completed emerge (2 of 17) dev-libs/zziplib-0.13.60-r1 to /
- 1332998160: >>> emerge (3 of 17) dev-tex/bibtexu-3.71_p20110705 to /
- 1332998160: === (3 of 17) Cleaning (dev-tex/bibtexu-3.71_p20110705::/usr/portage/dev-tex/bibtexu/bibtexu-3.71_p20110705.ebuild)
- 1332998165: === (3 of 17) Compiling/Merging (dev-tex/bibtexu-3.71_p20110705::/usr/portage/dev-tex/bibtexu/bibtexu-3.71_p20110705.ebuild)
- 1332998229: === (3 of 17) Merging (dev-tex/bibtexu-3.71_p20110705::/usr/portage/dev-tex/bibtexu/bibtexu-3.71_p20110705.ebuild)
- 1332998231: >>> AUTOCLEAN: dev-tex/bibtexu:0
- 1332998233: === (3 of 17) Post-Build Cleaning (dev-tex/bibtexu-3.71_p20110705::/usr/portage/dev-tex/bibtexu/bibtexu-3.71_p20110705.ebuild)
- 1332998233: ::: completed emerge (3 of 17) dev-tex/bibtexu-3.71_p20110705 to /
- 1332998233: >>> emerge (4 of 17) app-text/dvipsk-5.991_p20110705-r1 to /
- 1332998233: === (4 of 17) Cleaning (app-text/dvipsk-5.991_p20110705-r1::/usr/portage/app-text/dvipsk/dvipsk-5.991_p20110705-r1.ebuild)
- 1332998238: === (4 of 17) Compiling/Merging (app-text/dvipsk-5.991_p20110705-r1::/usr/portage/app-text/dvipsk/dvipsk-5.991_p20110705-r1.ebuild)
- 1332998313: === (4 of 17) Merging (app-text/dvipsk-5.991_p20110705-r1::/usr/portage/app-text/dvipsk/dvipsk-5.991_p20110705-r1.ebuild)
- 1332998314: >>> AUTOCLEAN: app-text/dvipsk:0
- 1332998316: === (4 of 17) Post-Build Cleaning (app-text/dvipsk-5.991_p20110705-r1::/usr/portage/app-text/dvipsk/dvipsk-5.991_p20110705-r1.ebuild)
- 1332998316: ::: completed emerge (4 of 17) app-text/dvipsk-5.991_p20110705-r1 to /
- 1332998316: >>> emerge (5 of 17) app-text/ps2pkm-1.5_p20110705 to /
- 1332998316: === (5 of 17) Cleaning (app-text/ps2pkm-1.5_p20110705::/usr/portage/app-text/ps2pkm/ps2pkm-1.5_p20110705.ebuild)
- 1332998321: === (5 of 17) Compiling/Merging (app-text/ps2pkm-1.5_p20110705::/usr/portage/app-text/ps2pkm/ps2pkm-1.5_p20110705.ebuild)
- 1332998376: === (5 of 17) Merging (app-text/ps2pkm-1.5_p20110705::/usr/portage/app-text/ps2pkm/ps2pkm-1.5_p20110705.ebuild)
- 1332998377: >>> AUTOCLEAN: app-text/ps2pkm:0
- 1332998379: === (5 of 17) Post-Build Cleaning (app-text/ps2pkm-1.5_p20110705::/usr/portage/app-text/ps2pkm/ps2pkm-1.5_p20110705.ebuild)
- 1332998379: ::: completed emerge (5 of 17) app-text/ps2pkm-1.5_p20110705 to /
- 1332998379: >>> emerge (6 of 17) x11-proto/printproto-1.0.5 to /
- 1332998379: === (6 of 17) Cleaning (x11-proto/printproto-1.0.5::/usr/portage/x11-proto/printproto/printproto-1.0.5.ebuild)
- 1332998379: === (6 of 17) Compiling/Merging (x11-proto/printproto-1.0.5::/usr/portage/x11-proto/printproto/printproto-1.0.5.ebuild)
- 1332998390: === (6 of 17) Merging (x11-proto/printproto-1.0.5::/usr/portage/x11-proto/printproto/printproto-1.0.5.ebuild)
- 1332998392: >>> AUTOCLEAN: x11-proto/printproto:0
- 1332998393: === (6 of 17) Post-Build Cleaning (x11-proto/printproto-1.0.5::/usr/portage/x11-proto/printproto/printproto-1.0.5.ebuild)
- 1332998393: ::: completed emerge (6 of 17) x11-proto/printproto-1.0.5 to /
- 1332998393: >>> emerge (7 of 17) virtual/perl-Getopt-Long-2.380.0-r1 to /
- 1332998393: === (7 of 17) Cleaning (virtual/perl-Getopt-Long-2.380.0-r1::/usr/portage/virtual/perl-Getopt-Long/perl-Getopt-Long-2.380.0-r1.ebuild)
- 1332998394: === (7 of 17) Compiling/Merging (virtual/perl-Getopt-Long-2.380.0-r1::/usr/portage/virtual/perl-Getopt-Long/perl-Getopt-Long-2.380.0-r1.ebuild)
- 1332998397: === (7 of 17) Merging (virtual/perl-Getopt-Long-2.380.0-r1::/usr/portage/virtual/perl-Getopt-Long/perl-Getopt-Long-2.380.0-r1.ebuild)
- 1332998397: >>> AUTOCLEAN: virtual/perl-Getopt-Long:0
- 1332998398: === (7 of 17) Post-Build Cleaning (virtual/perl-Getopt-Long-2.380.0-r1::/usr/portage/virtual/perl-Getopt-Long/perl-Getopt-Long-2.380.0-r1.ebuild)
- 1332998398: ::: completed emerge (7 of 17) virtual/perl-Getopt-Long-2.380.0-r1 to /
- 1332998399: >>> emerge (8 of 17) dev-tex/luatex-0.70.1 to /
- 1332998399: === (8 of 17) Cleaning (dev-tex/luatex-0.70.1::/usr/portage/dev-tex/luatex/luatex-0.7
使用grep命令選擇有用的行。文件名pack
- cat pack.log | grep ">>> emerge (" >> pack
文件形如:
- 1332998106: >>> emerge (2 of 17) dev-libs/zziplib-0.13.60-r1 to /
- 1332998160: >>> emerge (3 of 17) dev-tex/bibtexu-3.71_p20110705 to /
- 1332998233: >>> emerge (4 of 17) app-text/dvipsk-5.991_p20110705-r1 to /
- 1332998316: >>> emerge (5 of 17) app-text/ps2pkm-1.5_p20110705 to /
- 1332998379: >>> emerge (6 of 17) x11-proto/printproto-1.0.5 to /
- 1332998393: >>> emerge (7 of 17) virtual/perl-Getopt-Long-2.380.0-r1 to /
- 1332998399: >>> emerge (8 of 17) dev-tex/luatex-0.70.1 to /
- 1332998585: >>> emerge (9 of 17) x11-libs/libXp-1.0.1 to /
- 1332998605: >>> emerge (10 of 17) app-text/texlive-core-2011-r6 to /
- 1332999248: >>> emerge (11 of 17) dev-texlive/texlive-documentation-base-2011 to /
- 1332999255: >>> emerge (12 of 17) dev-texlive/texlive-basic-2011-r1 to /
- 1332999294: >>> emerge (13 of 17) dev-texlive/texlive-fontutils-2011 to /
- 1332999302: >>> emerge (14 of 17) dev-texlive/texlive-latex-2011 to /
- 1332999333: >>> emerge (15 of 17) dev-texlive/texlive-latexrecommended-2011 to /
- 1332999373: >>> emerge (16 of 17) virtual/latex-base-1.0 to /
- 1332999378: >>> emerge (17 of 17) app-vim/vim-latex-1.8.23.20110214 to /
- 1333027173: >>> emerge (1 of 13) app-admin/eselect-ruby-20100603 to /
- 1333027179: >>> emerge (2 of 13) app-text/teckit-2.5.1 to /
- 1333027254: >>> emerge (3 of 13) media-libs/silgraphite-2.3.1 to /
- 1333027347: >>> emerge (4 of 13) app-text/xdvipdfmx-0.7.8_p20100722 to /
- 1333027417: >>> emerge (5 of 13) app-text/texlive-core-2011-r6 to /
- 1333028348: >>> emerge (6 of 13) dev-lang/ruby-1.8.7_p357 to /
- 1333028497: >>> emerge (7 of 13) dev-texlive/texlive-latex-2011 to /
- 1333028526: >>> emerge (8 of 13) dev-texlive/texlive-fontsrecommended-2011 to /
- 1333028642: >>> emerge (9 of 13) dev-texlive/texlive-genericrecommended-2011 to /
- 1333028649: >>> emerge (10 of 13) dev-texlive/texlive-pictures-2011 to /
- 1333028670: >>> emerge (11 of 13) dev-texlive/texlive-latexextra-2011-r2 to /
- 1333028788: >>> emerge (12 of 13) dev-texlive/texlive-mathextra-2011 to /
- 1333028808: >>> emerge (13 of 13) dev-texlive/texlive-xetex-2011 to /
- 1333069989: >>> emerge (1 of 2) virtual/tex-base-0 to /
- 1333069998: >>> emerge (2 of 2) app-text/dvipdfmx-20110311 to /
- 1333105118: >>> emerge (1 of 1) dev-tex/cjk-latex-4.8.2 to /
- 1333108086: >>> emerge (1 of 24) app-text/t1utils-1.36 to /
- 1333108100: >>> emerge (2 of 24) dev-texlive/texlive-metapost-2011 to /
- 1333108113: >>> emerge (3 of 24) dev-texlive/texlive-texinfo-2011 to /
- 1333108121: >>> emerge (4 of 24) dev-texlive/texlive-langcyrillic-2011 to /
- 1333108170: >>> emerge (5 of 24) app-text/texi2html-1.78 to /
- 1333108182: >>> emerge (6 of 24) app-text/psutils-1.17 to /
- 1333108190: >>> emerge (7 of 24) app-text/ps2eps-1.64 to /
- 1333108196: >>> emerge (8 of 24) media-gfx/sam2p-0.47 to /
- 1333108235: >>> emerge (9 of 24) dev-texlive/texlive-htmlxml-2011 to /
- 1333108243: >>> emerge (10 of 24) dev-texlive/texlive-langenglish-2011 to /
- 1333108258: >>> emerge (11 of 24) media-libs/t1lib-5.1.2 to /
然後使用cut命令剪切軟件包名稱部分,保存到pack1
- cut -d' ' -f8-9 pack >> pack1
卸載軟件包的包的名稱不能接軟件的版本信息,只好手動刪除了(汗......我也知道一句簡單的命令可以搞定)
然後將回車符號全部替換為空格,最後得到pack2文件
形如:
- dev-libs/zziplib-0.13.60-r1 dev-tex/bibtexu-3.71_p20110705 app-text/dvipsk-5.991_p20110705-r1 app-text/ps2pkm-1.5_p20110705 x11-pro /printpro -1.0.5 virtual/perl-Ge pt-Long-2.380.0-r1 dev-tex/luatex-0.70.1 x11-libs/libXp-1.0.1 app-text/texlive-core-2011-r6 dev-texlive/texlive-documentation-base-2011 dev-texlive/texlive-basic-2011-r1 dev-texlive/texlive-fontutils-2011 dev-texlive/texlive-latex-2011 dev-texlive/texlive-latexrecommended-2011 virtual/latex-base-1.0 app-vim/vim-latex-1.8.23.20110214 app-admin/eselect-ruby-20100603 app-text/teckit-2.5.1 media-libs/silgraphite-2.3.1 app-text/xdvipdfmx-0.7.8_p20100722 app-text/texlive-core-2011-r6 dev-lang/ruby-1.8.7_p357 dev-texlive/texlive-latex-2011 dev-texlive/texlive-fontsrecommended-2011 dev-texlive/texlive-genericrecommended-2011 dev-texlive/texlive-pictures-2011 dev-texlive/texlive-latexextra-2011-r2 dev-texlive/texlive-mathextra-2011 dev-texlive/texlive-xetex-2011 virtual/tex-base-0 app-text/dvipdfmx-20110311 dev-tex/cjk-latex-4.8.2 app-text/t1utils-1.36 dev-texlive/texlive-metapost-2011 dev-texlive/texlive-texinfo-2011 dev-texlive/texlive-langcyrillic-2011 app-text/texi2html-1.78 app-text/psutils-1.17 app-text/ps2eps-1.64 media-gfx/sam2p-0.47 dev-texlive/texlive-htmlxml-2011 dev-texlive/texlive-langenglish-2011 media-libs/t1lib-5.1.2 dev-tex/xcolor-2.11 dev-tex/xmltex-1.9-r2 app-text/xdvik-22.84.16 media-libs/freetype-1.4_pre20080316-r2 app-text/lcdf-type ols-2.91 dev-tex/feynmf-1.08-r3 media-libs/gd-2.0.35-r3 virtual/texi2dvi-0 app-text/dvipng-1.14 app-text/passivetex-1.25 dev-tex/pgf-2.10 dev-tex/latex-beamer-3.11 app-text/texlive-2011
這樣使用命令emerge -C 然後粘貼包名到控制台即可。軟件包徹底移除。