Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/perl -w
- use List::Util qw(first);
- my @KEYS=`ls /var/cache/apt/archives/`;
- foreach my $KEY(@KEYS)
- {
- $KEY=~s/_.*//p;
- my $verstr=$&;
- #print $verstr;
- $_=first{defined($_)}grep /$KEY/,`aptitude search $KEY`;
- print($_);
- if(m/^i/)
- {
- print("Package $KEY is installed.\n\r");
- }
- if (m/^p/)
- {
- print("Package $KEY has no trace of the package exists on the system, it will be installed.\n\r" );
- }
- if (m/^c/)
- {
- print("Package $KEY was deleted but its configuration files remain on the system.\n\r" );
- }
- if (m/^v/)
- {
- print("Package $KEY is virtual\n\r" );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement