Sponsored Content
Operating Systems Linux Red Hat How to remove installed RPMs by a specific date? Post 302529892 by click on Saturday 11th of June 2011 03:23:01 AM
Old 06-11-2011
You can view all rpms by date with

Code:
rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n'

With this you can view only the packages names

Code:
rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n' | grep "Mon 15 Feb 2010" | awk '{ print $9}'

Finally this script will erase all rpms from give date

Code:
for rpm in $(rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n' | grep "Mon 15 Feb 2010" | awk '{ print $9}'); 
do rpm -e $rpm" 
done

 

10 More Discussions You Might Find Interesting

1. AIX

Date Patch was Installed

HI All, Is it possible to find from An AIX server when a Patch was installed like by using "instfix" with a parameter that shows when was this installed. Thank You (5 Replies)
Discussion started by: sellafrica1
5 Replies

2. Programming

How To find if Specific Software is installed ?

Hi all, I have developed an application in linux that uses MySQL and unixODBC. Now I am making a small installer for this application that configures environment for this application. What I need is the way to check if MySQL and unixODBC is installed on the system before I start installing my... (3 Replies)
Discussion started by: noble_curious
3 Replies

3. Linux

Get the OS Installed date

Hi, How to get OS installed date in Linux using terminal command? Thanks is advance (3 Replies)
Discussion started by: forumguest
3 Replies

4. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

5. Solaris

List of patches and date installed

Does anyone know of a command that would show the list of patches installed and the date it was installed? My understanding is that "showrev -p" would show patches but not the date they were installed. I'm looking for this on a Solaris 10 server. Thanks. (2 Replies)
Discussion started by: ixauditor
2 Replies

6. UNIX for Dummies Questions & Answers

Search specific string logfile specific date range

Hi, I have logfile like this.. === 2014-02-09 15:46:59,936 INFO RequestContext - URL: '/eyisp/sc/skins/EY/images/pickers/comboBoxPicker_Over.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko': Unsupported with Accept-Encoding header === 2015-02-09... (8 Replies)
Discussion started by: kishk
8 Replies

7. Shell Programming and Scripting

Date: invalid date trying to set Linux date in specific format

i try to set linux date & time in specific format but it keep giving me error Example : date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" or date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" keep giving me this error : date: invalid date ‘19-01-2017 00:05:01' Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies

8. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies

9. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies

10. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies
RPMSPEC(8)						      System Manager's Manual							RPMSPEC(8)

NAME
rpmspec - RPM Spec Tool SYNOPSIS
QUERYING SPEC FILES: rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ... select-options [--rpms] [--srpms] query-options [--qf,--queryformat QUERYFMT] [--target TARGET_PLATFORM] QUERY OPTIONS The general form of an rpm spec query command is rpm {-q|--query} [select-options] [query-options] You may specify the format that the information should be printed in. To do this, you use the --qf|--queryformat QUERYFMT option, followed by the QUERYFMT format string. See rpm(8) for details. SELECT OPTIONS --rpms Operate on the binary package header(s). --srpm Operate on the source package header(s). SEE ALSO
popt(3), rpm(8), rpmdb(8), rpmkeys(8), rpmsign(8), rpm2cpio(8), rpmbuild(8), rpmspec --help - as rpm supports customizing the options via popt aliases it's impossible to guarantee that what's described in the manual matches what's available. http://www.rpm.org/ <URL:http://www.rpm.org/> AUTHORS
Marc Ewing <marc@redhat.com> Jeff Johnson <jbj@redhat.com> Erik Troan <ewt@redhat.com> Panu Matilainen <pmatilai@redhat.com> Red Hat, Inc 29 October 2010 RPMSPEC(8)
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy