使用perl批量卸载软件

 昨天晚上下载了wine,用了用很不爽,打算卸载掉,使用yum remove wine后,发现还有好多wine相关程序没有卸载掉。剩下的我是使用下列方法弄得

1.使用rpm -aq | grep wine > ./uninstall 查看剩余wine相关程序,并将结果到处到本地目录uninstall文件中

[root@localhost tiger506]# cat ./uninstall 

wine-pulseaudio-1.5.3-1.fc16.x86_64

wine-ldap-1.5.3-1.fc16.i686

wine-capi-1.5.3-1.fc16.x86_64

wine-cms-1.5.3-1.fc16.i686

wine-alsa-1.5.3-1.fc16.x86_64

wine-symbol-fonts-1.5.3-1.fc16.noarch

wine-wow-1.5.3-1.fc16.x86_64

wine-openal-1.5.3-1.fc16.x86_64

wine-openal-1.5.3-1.fc16.i686

wine-small-fonts-1.5.3-1.fc16.noarch

wine-ldap-1.5.3-1.fc16.x86_64

wine-twain-1.5.3-1.fc16.i686

wine-core-1.5.3-1.fc16.x86_64

wine-courier-fonts-1.5.3-1.fc16.noarch

wine-marlett-fonts-1.5.3-1.fc16.noarch

wine-pulseaudio-1.5.3-1.fc16.i686

wine-systemd-1.5.3-1.fc16.noarch

wine-twain-1.5.3-1.fc16.x86_64

wine-fonts-1.5.3-1.fc16.noarch

wine-core-1.5.3-1.fc16.i686

wine-capi-1.5.3-1.fc16.i686

wine-cms-1.5.3-1.fc16.x86_64

wine-tahoma-fonts-1.5.3-1.fc16.noarch

wine-system-fonts-1.5.3-1.fc16.noarch

wine-desktop-1.5.3-1.fc16.noarch

wine-common-1.5.3-1.fc16.noarch

wine-ms-sans-serif-fonts-1.5.3-1.fc16.noarch

wine-alsa-1.5.3-1.fc16.i686

2.在当前目录创建perl脚本a1.pl

[root@localhost tiger506]# cat ./a1.pl 

#!/usr/bin/perl

open UF,"<./uninstall";

while(<UF>){

system("yum -y  remove $_");

}

3.使用chmod u+x ./a1.pl,使得程序得以执行。
4.执行./a1.pl
5.等会儿就好了。




本文转自 tiger506 51CTO博客,原文链接:http://blog.51cto.com/tiger506/905790,如需转载请自行联系原作者

上一篇:《HTML5+CSS3网页设计入门必读》——1.9 在不涉及Web服务器的情况下分发内容


下一篇:ASP.NET 进阶】仿百度文库文档在线预览(支持格式.pdf,.doc,docx,xls,xlsx,.ppt,pptx)