How to update Redhat packages to a given point in time not to the latest
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.