Batch uninstall software using perl in CentOS

Source: Internet
Author: User
Tags perl script
I downloaded wine last night and tried it very well. I planned to uninstall it. after using yumremovewine, I found that many wine related programs were not uninstalled. The rest is obtained by using the following methods. use rpm-aq | grepwine & gt ;. /uninstall to view the remaining wine related programs and add the results to the local directory uninstall [root @ localhosttiger506] # cat. /uninstall

I downloaded wine last night. It was quite uncomfortable to use it. I planned to uninstall it. After I used yum remove wine, I found that many wine related programs were not uninstalled. The rest is made by using the following methods:

1. run rpm-aq | grep wine>./uninstall to view the remaining wine-related programs and add the results to the uninstall file in the local directory.


[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. create the perl script a1.pl in the current directory.


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

#! /Usr/bin/perl

Open UF, "<./uninstall ";

While ( ){

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

}

3. run the chmod u + x./a1.pl program. 4. Execute./a1.pl5. it will be fine later.


This article from the "struggle to achieve excellence" blog, please be sure to keep this source http://tiger506.blog.51cto.com/318536/905790


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.