[CentOS] Easy way to strip down CentOS?

Wed Feb 25 19:34:22 UTC 2015
Frank Cox <theatre at melvilletheatre.com>

On Wed, 25 Feb 2015 20:04:22 +0100
Niki Kovacs wrote:

> how do you manage from 
> there to get back to exactly the base system you had from the start?

My approach would be to create a list of installed rpms for what you're using as the base system:

rpm -qa --qf "%{NAME}\n" | sort > starting.txt

Run that command again when you have all of the extra stuff installed, using a different filename for the output, for example, ending.txt

Now merge and compare those files, and pull out the unique entries:

sort starting.txt ending.txt | uniq -u > newstuff.txt

Now remove the files in newstuff.txt

yum remove `cat newstuff.txt`

There is probably a way to combine those last two steps into one single command.

-- 
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com