[opensuse-factory] Script to remove excess rpm packages?
Hi. Here's my situation: I have a test machine which I update once or twice a week. I save the update rpms, and when important things are in sync (I can run vmware, for example), I take the saved rpms over to my work machine and do an update there. It has been such a long time since I've updated the work machine that I have 100,000 update rpms for an installed base of 10,000 packages. Some of the package updates have 15-20 versions. I've tried, but it takes forever to "thin out the herd", so there's at most a couple of versions so that the update solver isn't going to run forever trying to figure out what to do. Does anyone have a script that will reduce the number of versions of each package down to one or two? Thanks, Steve CASA-1.7.1592-4.10.i586.rpm CASA-1.7.1592-4.14.i586.rpm CASA-1.7.1592-4.17.i586.rpm CASA-1.7.1592-4.19.i586.rpm CASA-1.7.1592-4.20.i586.rpm CASA-1.7.1592-4.21.i586.rpm CASA-1.7.1592-4.22.i586.rpm CASA-1.7.1592-4.23.i586.rpm CASA-1.7.1592-4.24.i586.rpm CASA-1.7.1592-4.26.i586.rpm CASA-1.7.1592-4.27.i586.rpm CASA-1.7.1592-4.28.i586.rpm CASA-1.7.1592-4.29.i586.rpm CASA-1.7.1592-4.32.i586.rpm CASA-1.7.1592-4.33.i586.rpm CASA-1.7.1592-4.36.i586.rpm CASA-1.7.1592-4.42.i586.rpm CASA-1.7.1592-4.9.i586.rpm Limit it to -4.42, or -4.36 and -4.42, for example. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
Hi Space, On Tue, 27 Oct 2009 20:53:28 -0700 wormey@eskimo.com (Space Case) wrote:
Does anyone have a script that will reduce the number of versions of each package down to one or two?
I used this one to clean up the osc build package cache, back when I was young and stupid and still test-building against FACTORY ;) seife@strolchi:~> cat bin/clean-osbuild-packagecache.sh #!/bin/sh DIR=$1 if [ -z "$DIR" ]; then echo "please give directory!" exit 1 fi cd $DIR PKGS=$(ls |sed 's/-[[:digit:]].*-[[:digit:]].*\.rpm//'| sort -u) for i in $PKGS; do ls -t ${i}-[0-9]*-[0-9]*.rpm|tail -n +2|xargs --no-run-if-empty rm done ##### This actually goes for the timestamp of the Packages IIRC and it was not 100% perfect, but it served my purpose (reducing the amount of disk space wasted by osc) well. -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
Thanks, saved me a ton of work! Steve On Oct 28, 11:03am, Stefan Seyfried wrote:
On Tue, 27 Oct 2009 20:53:28 -0700 wormey@eskimo.com (Space Case) wrote:
Does anyone have a script that will reduce the number of versions of each package down to one or two?
I used this one to clean up the osc build package cache, back when I was young and stupid and still test-building against FACTORY ;)
seife@strolchi:~> cat bin/clean-osbuild-packagecache.sh #!/bin/sh
DIR=$1 if [ -z "$DIR" ]; then echo "please give directory!" exit 1 fi
cd $DIR PKGS=$(ls |sed 's/-[[:digit:]].*-[[:digit:]].*\.rpm//'| sort -u)
for i in $PKGS; do ls -t ${i}-[0-9]*-[0-9]*.rpm|tail -n +2|xargs --no-run-if-empty rm done #####
This actually goes for the timestamp of the Packages IIRC and it was not 100% perfect, but it served my purpose (reducing the amount of disk space wasted by osc) well. -- Stefan Seyfried
"Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org }-- End of excerpt from Stefan Seyfried
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On 28/10/09 07:03, Stefan Seyfried wrote:
This actually goes for the timestamp of the Packages IIRC and it was not 100% perfect, but it served my purpose (reducing the amount of disk space wasted by osc) well.
IMHO this is a bug, osc build should clean older packages. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Wed, 28 Oct 2009 12:09:09 -0300
Cristian Rodríguez
IMHO this is a bug, osc build should clean older packages.
"should" as in "it should do this but does not for some reason" or "should" as in "somebody should implement that osc build cleans up older packages"? I have to admit that I did not have the problem in recent versions, but simply because I just test-build against latest-released-product and then submit to FACTORY and hope that it does not blow up ;) -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On 28/10/09 12:22, Stefan Seyfried wrote:
On Wed, 28 Oct 2009 12:09:09 -0300 Cristian Rodríguez
wrote: IMHO this is a bug, osc build should clean older packages.
"should" as in "it should do this but does not for some reason"
Yes.
then submit to FACTORY and hope that it does not blow up ;)
It may blow up. heh ;) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Wed, 28 Oct 2009 12:27:46 -0300
Cristian Rodríguez
On 28/10/09 12:22, Stefan Seyfried wrote:
"should" as in "it should do this but does not for some reason"
Yes.
Ok. Do I need a special "cleanup" command or should it just clean up old crap when it downloads new?
then submit to FACTORY and hope that it does not blow up ;)
It may blow up. heh ;)
Well, this is why I test in my home project before submitreq'ing ;) -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
participants (3)
-
Cristian Rodríguez
-
Stefan Seyfried
-
wormey@eskimo.com