LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 07-04-2008, 09:36 AM   #1
proteus2
LQ Newbie
 
Registered: May 2005
Posts: 3

Rep: Reputation: 0
snapshot in time of rpm's installed


Hi All,

I'm using RHEL4 i386 and I'm creating template servers.
The problem I'm having is related to changes being made to the rpm packages installed.

I'd like to have a cron job that keeps track of the installed packages on a given date and to be able to restore the installed packages or rpm database back to that point in time.

It is possible to do this with Ubuntu by doing a:
crontab -> dpkg --get-selections > /tmp/dpkglist[date].txt
to get a list of installed packages

and then a:
dpkg --set-selections < /tmp/dpkglist[date].txt
to restore these packages.

In Redhat, I know I can backup the /var/lib/rpm directory but I don't understand how the rpm database really works if I needed to get back to a system state in time. I.e process to install/remove all packages to achieve a given snapshot state.


Is there a way to achieve the above?

DM
 
Old 07-04-2008, 10:54 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
Quote:
Originally Posted by proteus2 View Post
I'd like to have a cron job that keeps track of the installed packages on a given date
Date IMHO is easiest to work with when converted to epoch. Luckily 'rpm --qf' allows that format so selecting by grepping for epoch should be fast and workable: list packages with --qf format %name and %epoch; awk /epoch/ print name; use list of names as input for reinstall/restore.


Quote:
Originally Posted by proteus2 View Post
and to be able to restore the installed packages or rpm database back to that point in time.
Restoring could mean reinstalling or rollback: be aware rollback must be enabled *before* packages are updated and reinstalling could require use of --force. Whatever you want to do it is possible but the question is what the *reason* for restore is (config fsck ups, pristine state testing, et cetera) and what its scope is ("rpm -g someGroup", few packages, whole system). Answering that could make it easier to find a solution.
 
Old 07-04-2008, 11:56 AM   #3
proteus2
LQ Newbie
 
Registered: May 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the response unSpawn.

Quote:
Originally Posted by unSpawn View Post
the question is what the *reason* for restore is (config fsck ups, pristine state testing, et cetera) and what its scope is ("rpm -g someGroup", few packages, whole system). Answering that could make it easier to find a solution.
The restore reason is most like "pristine state testing".
As I am building a template server, I want to have a basic system without the following:
X window(s), Multi-media programs, printer support, GUI programs, any utility/application that I will never use.


If the template is to be deployed as a webserver or a mailserver, a script will install a bunch of relevant packages and if something goes wrong, I need to get back to a clean system state.

I've never used the RPM/up2date roll-back facilities before and I found very little on the Web about rolling back packages/snapshots.



Quote:
Originally Posted by unSpawn View Post
config fsck ups
Did you mean fu*k-ups or FileSystem ChecK ups?
Quote:
Originally Posted by The Simpsons
Fat Tony: Gentlemen, we must determine which of our fellow inmates has become the rodentus incarcererium.
Gangster #1: You heard the boss! Find the rat!
Gangster #2: I found the rat, and he's right here! [Points to gangster #3]
Gangster #3: I ain't the rat, I'm the pigeon!
Gangster #4: I thought you was the mole!
Gangster #2: No, you're thinkin' of that guy who was the canary, but we can all agree, we work in a business with a very rich lexicon!
All the gangsters nod, mutter in agreement: "Rich lexicon" "Very rich!" "Oh yes."
 
Old 07-04-2008, 02:59 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
Quote:
Originally Posted by proteus2 View Post
The restore reason is most like "pristine state testing".
Then wouldn't automated Kickstart install be more efficient?


Quote:
Originally Posted by proteus2 View Post
Did you mean fu*k-ups or FileSystem ChecK ups?
You pretty well know what I mean: SNAFU, basically.
 
Old 07-04-2008, 05:22 PM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Look into SystemImager if you need a template type system when you want to revert back, etc.
 
  


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
list of installed packages (or rpm's) soylentgreen Fedora 3 05-17-2007 08:51 AM
Are source RPM's and binary RPM's installed the same way? Simon Adebisi Linux - Software 3 06-28-2005 03:45 AM
how to tell if rpm's installed rhl9 d4nnn Linux - Newbie 2 03-26-2004 04:23 PM
verification of rpm's installed cjae Linux - Newbie 2 03-12-2004 02:08 AM
RPM's not completly installed? snatale1 Linux - Newbie 2 08-29-2003 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

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