主机平台: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命令选择有用的行。文件名packcat pack.log | grep ">>> emerge (" >> pack
文件形如: