If you're upgrading via apt on everyday basis from unstable branches like I am :) and want to keep a backup of the few most recent versions of your packages in case of emergency downgrade, then THIS TOOL IS FOR YOU :)
aptsamever.py --usage will show you the list of possible options
but in general:
There are in fact 3 possible main actions you can do with aptsamever: status, list, del
--status will show you condensed information about your apt cache without doing or touching anything
--list will list all the packages matching desired criteria (--untouch level, --old, --new, --all, etc)
--del does exactly what --list does but it physically removes the files instead of listing them to standard output, so use with care
If you're running the tool by hand and want to see nice fireworks :) then you can add -v (--verbose) option for some neat progress bars etc :)
On the other hand, if you want to run it in some kind of another script for automatization (e.g. cron task) then -y (--yes) option could be useful for you, especially when combined with --del which always asks for user confirmation. This option disables the usual behavior.
For some customization, you can play a bit with -u (--untouch) option which sets the recentness of packages you're interested in.
If you use positive value, e.g. -u 2, then the tool takes into consideration all packages except their two newest releases thus keeping two most recent versions of each package untouched by --list or --del.
The value of 0 affects all packages and all their versions. So -u 0 combined with -l lists complete contents of apt cache directory :)
And negative value, e.g. -1 is exact opposite of its positive counterpart because it affects exactly the newest version of each package, leaving the older versions untouched.
If you have questions or new ideas, don't hesitate to write me.
Brian
<brian@linuxee.sk>
