LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-11-2011, 04:36 AM   #1
unixmania
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Rep: Reputation: Disabled
Question How to update Redhat packages to a given point in time not to the latest


Hi
I have to update packages on Redhat 4 and 5 servers to a certain point in time ie update the systems to say the latest packages available as at 31st Aug 2011. I don't need to update to the latest ones where I can easliy use yum (for redhat 5) and up2date (for redhat 4)? Anyone can help?
 
Old 11-11-2011, 05:53 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Try querying downloaded but not yet installed packages for where build time is less than or equal to your local representation of 2011-08-31?

Example:
Code:
# Clean cache:
yum -y clean all
# Cache packages by only downloading them but you could also mirror a repo:
yum -y --update --downloadonly
# Set date limit as epoch:
USEDATE=$(date --date="2011-08-31" +%s)
# Find packages and query custom format:
find /var/cache/yum/ -type f -iname \*.rpm -exec rpm -qp '{}' --qf="%{NAME} %{BUILDTIME}\n" \; \
| while read PACKAGE EPOCH; do [ $EPOCH -le $USEDATE ] && echo $PACKAGE; done
...still feels a bit kludgy though.
 
1 members found this post helpful.
Old 11-11-2011, 07:23 PM   #3
unixmania
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks. So can we update packages on running servers or we need to be in single user mode?
 
Old 11-11-2011, 07:52 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
No but as processes get loaded from binaries and libraries on disk certain changes won't be available until processes are (reconfigured and) restarted or kexec'ed (kernel).
 
Old 11-11-2011, 09:37 PM   #5
the_gripmaster
Member
 
Registered: Jul 2004
Location: VIC, Australia
Distribution: RHEL, CentOS, Ubuntu Server, Ubuntu
Posts: 364

Rep: Reputation: 38
Quote:
Originally Posted by unSpawn View Post
Try querying downloaded but not yet installed packages for where build time is less than or equal to your local representation of 2011-08-31?

Example:
Code:
# Clean cache:
yum -y clean all
# Cache packages by only downloading them but you could also mirror a repo:
yum -y --update --downloadonly
# Set date limit as epoch:
USEDATE=$(date --date="2011-08-31" +%s)
# Find packages and query custom format:
find /var/cache/yum/ -type f -iname \*.rpm -exec rpm -qp '{}' --qf="%{NAME} %{BUILDTIME}\n" \; \
| while read PACKAGE EPOCH; do [ $EPOCH -le $USEDATE ] && echo $PACKAGE; done
...still feels a bit kludgy though.
The requirement of the OP is a bit tricky. This code will actually download the latest available packages. and the find command will only find the rpms which were not updated after 20110831. The code will fail to find rpms, say, an rpm which was uodated on 20110830 and again on 20111010. Unless there is a way to download all updates packages ysing yum.
 
Old 11-12-2011, 05:07 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by the_gripmaster View Post
This code will actually download the latest available packages.
Yeah, you're right. He should D/L repo contents instead.


Quote:
Originally Posted by the_gripmaster View Post
the find command will only find the rpms which were not updated after 20110831.
As per his requirement.


Quote:
Originally Posted by the_gripmaster View Post
The code will fail to find rpms, say, an rpm which was uodated on 20110830 and again on 20111010.
If you are alluding to his reason for doing so I don't know but I can think up a scenario.
 
  


Reply



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
[SOLVED] How do I update RedHat 5.1 x86_64 iso with latest RPM's stuart_cherrington Red Hat 2 08-12-2008 10:16 AM
redhat 9-shrike update packages??? plusxi General 4 05-02-2007 07:57 AM
X won't start except as root after latest Redhat/Fedora update hlslaughter Linux - Software 2 10-25-2004 06:03 PM
How to upgrade latest packages under RedHat? fhleung Linux - General 1 09-01-2004 06:27 AM
redhat-update-packages -- dependencies failing dkaplowitz Red Hat 3 11-25-2003 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:44 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