LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-25-2014, 03:03 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
[yum] How to check when is an RPM installed/updated last time?


Hi,

I use the RedHat Linux. I use quite often the command 'yum' to install, update or upgrade the RPM packages. Sometimes I want to know when is a pachage installed or updated last time.
 
Old 03-25-2014, 03:06 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
yum.log will record all of your update activities
OR
yum history
 
2 members found this post helpful.
Old 03-25-2014, 03:08 AM   #3
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

see /var/log/yum.log*

Evo2.
 
1 members found this post helpful.
Old 03-25-2014, 03:18 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
YUM history and logs :
http://docs.fedoraproject.org/en-US/...e/ch05s16.html


The "rpm last" command may also be useful :
$ rpm -qa --last | grep <name> (or part of package name)

Saving an install list with date/time, the latest install in line 1:
$ rpm -qa --last > last-packages.txt

-
 
1 members found this post helpful.
Old 03-25-2014, 03:37 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by kirukan View Post
yum.log will record all of your update activities
OR
yum history
Yes, I know the file /var/log/yum.log. But it seems it just contains the information from begin this year. I think this could be configured to contain longer log information. Right?
 
Old 03-25-2014, 03:45 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by thomas2004ch View Post
Yes, I know the file /var/log/yum.log. But it seems it just contains the information from begin this year.
Did you check for rotated log files? Ie /var/log/yum.log* (as suggested earlier).

Evo2.
 
Old 03-25-2014, 04:02 AM   #7
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by knudfl View Post
YUM history and logs :
http://docs.fedoraproject.org/en-US/...e/ch05s16.html


The "rpm last" command may also be useful :
$ rpm -qa --last | grep <name> (or part of package name)

Saving an install list with date/time, the latest install in line 1:
$ rpm -qa --last > last-packages.txt

-
I think this command does nothing else than read in the file /var/log/yum.log, right?
 
Old 03-25-2014, 04:06 AM   #8
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by evo2 View Post
Hi,

Did you check for rotated log files? Ie /var/log/yum.log* (as suggested earlier).

Evo2.
Here is rotation for yum.log:

Code:
/var/log/yum.log {
    missingok
    notifempty
    size 30k
    yearly
    create 0600 root root
}
I think I have to increase the size from 30K to a larger size, right?

But if I even want to see the record from last January, should I take out the yearly and set 600 days for example?

I list the file size of /var/log.yum.log and it tells as follow:
Code:
# ll -h /var/log/yum.log
-rw------- 1 root root 48K Mar 21 11:24 /var/log/yum.log
One can see the size is not 30K but 48K. Why?

Last edited by thomas2004ch; 03-25-2014 at 04:11 AM.
 
Old 03-25-2014, 04:15 AM   #9
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Because the logrotate is yearly
 
Old 03-25-2014, 04:27 AM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
I think you'll find rpm reads the rpm db (/var/lib/rpm/ on Centos 6)
 
1 members found this post helpful.
Old 03-25-2014, 04:53 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 7 .
Quote:
I think this command does nothing else than read in the file /var/log/yum.log
See post #10, @chrism01.

$ rpm -qa <-etc. option> : Uses the "rpm data base" (/var/lib/rpm/),
which means that also packages installed without using yum are listed.
I.e. packages installed with # rpm -Uvh <package.rpm>

-
 
1 members found this post helpful.
Old 03-25-2014, 09:01 AM   #12
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Can someone answer my question in post #8 at the end?
 
Old 03-25-2014, 09:57 AM   #13
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
man logrotate
 
Old 03-25-2014, 10:32 AM   #14
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,792

Rep: Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220
Quote:
Originally Posted by thomas2004ch View Post
Here is rotation for yum.log:

Code:
/var/log/yum.log {
    missingok
    notifempty
    size 30k
    yearly
    create 0600 root root
}
I list the file size of /var/log.yum.log and it tells as follow:
Code:
# ll -h /var/log/yum.log
-rw------- 1 root root 48K Mar 21 11:24 /var/log/yum.log
One can see the size is not 30K but 48K. Why?
You can't have two conditions. The last one, in this case "yearly", overrides. If you run logrotate with the "-d" flag you will see that it is using only the "yearly" test.
 
Old 03-25-2014, 10:40 AM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,792

Rep: Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220
The most straightforward way to find the install/update date for a package is to run "rpm -qi {packagename}" and note the line that begins "Install Date:".
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save a rpm downloaded & installed by "yum install xxx.rpm" command shashi1234567 Linux - Networking 3 12-25-2009 10:49 AM
kernel rpm installed but grub.conf not updated laginagesh Linux - Software 1 10-06-2009 01:25 AM
installed apache from source, didn't remove rpm, updated rpm causes problems leftPeg Linux - Newbie 5 06-06-2007 09:20 PM
how to keep the rpm from yum installed NAC Fedora 8 11-19-2006 11:07 AM
How to check SW installed not by rpm maxgg Linux - Newbie 1 12-23-2004 09:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration