Gentoo Linux--使用日志信息完整卸载软件包

原创 2012年03月30日 21:07:16

主机平台:Gentoo Linux 11.2

内核版本:Linux Kernel 3.2.1

原创作品,转载请标明出处http://blog.csdn.net/yming0221/article/details/7412997


我们都喜欢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 然后粘贴包名到控制台即可。软件包彻底移除。



版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

Android ADB命令大全(通过ADB命令查看wifi密码、MAC地址、设备信息、操作文件、查看文件、日志信息、卸载、启动和安装APK等)

http://zmywly8866.github.io/2015/01/24/all-adb-command.html ADB很强大,记住一些ADB命令有助于提高工作效率。 获取序...
  • ztguang
  • ztguang
  • 2016年06月17日 22:30
  • 444

Android ADB命令大全(通过ADB命令查看wifi密码、MAC地址、设备信息、操作文件、查看文件、日志信息、卸载、启动和安装APK等)

http://zmywly8866.github.io/2015/01/24/all-adb-command.html、操作文件、  ADB很强大,记住一些ADB命令有助于提高工作效率。 获取序...

Android adb命令大全(通过adb命令查看wifi密码、MAC地址、设备信息、操作文件、查看文件、日志信息、卸载、启动和安装APK等)

adb命令很强大,记住一些adb命令有助于提高工作效率。 获取序列号: adb get-serialno 查看连接计算机的设备: adb devices 重启机器: ...

Android ADB命令大全(通过ADB命令查看wifi密码、MAC地址、设备信息、操作文件、查看文件、日志信息、卸载、启动和安装APK等)

 ADB很强大,记住一些ADB命令有助于提高工作效率。 获取序列号: adb get-serialno 查看连接计算机的设备: adb devices 重启机器: ...

Linux系统的输出的日志信息查看

一、printk()的介绍 Linux系统在开机的过程中我们可以看见很多打印信息,这都是Linux内核内部调用printk(level,message)函数打印出来的 其中level是定义的打印级别,...

linux less从后向前查看日志信息

线上出问题的时候,我们常用tail -n  或者 tail -f 或者grep 或者 vi cat等各种命令去查看异常信息, 但是日志是在不停地刷屏,tail是动态的在变的,我们往往期望从日志最后一行...
  • haihaa
  • haihaa
  • 2017年08月02日 09:37
  • 129

使用commons.logging结合log4j显示调试和日志信息

请在我上一篇博客“使用commons.logging中的simplelog显示调试和日志信息”建立的工程的基础上再行操作。 1、到http://archive.apache.org/dist/log...
  • gxmark
  • gxmark
  • 2012年03月11日 21:19
  • 763

1git命令的使用,查看git仓库状态,添加文件到git跟踪,git提交,查看git分支,查看git仓库日志信息,切换git分支,解决git分支合并后出现冲突的问题

1新建一个存储git的文件夹,命令是: toto@toto-K45VD:~$ mkdir gitfolder 2初始化一个git仓库,命令是: toto@toto-K4...

Java web中使用Log4j记录日志信息

最近想记录一下Log4j的使用,抽了点时间通过收集网上的资料整理了这份博客,希望给需要用Log4j记录日志的朋友一点帮助,若有不对的地方,望指正。 Log4j是Apache的一个开源项目,通过使用Lo...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Gentoo Linux--使用日志信息完整卸载软件包
举报原因:
原因补充:

(最多只允许输入30个字)