Tidy RPM Cache script (previously known as Delete Obsolete RPMS) is a handy tool that helps you clean up old RPM files from your directories. It's pretty useful if you want to keep your system tidy and save some disk space!
This Python script can delete obsolete RPM package files from your package manager's cache. If you're using Linux distributions like Fedora, this script can really help minimize the disk space taken up by outdated update packages.
To get started, here's how you run the script:
rm_obsolete_rpms.py {-d|--dir=dir} {-n|--num-obsolete=number} {-x|--exclude=reg-ex} {-f|--force} {-s|--srpm} {-v|--verbose} {-q|--quiet} {--log-prefix=text} {-u|--usage} {-h|--help} {--version}
The script checks the version info of all RPM files to find out which ones are outdated. You can tell it where to look and even exclude certain packages from being cleaned up.
If you want to delete obsolete RPMs from a specific directory like '/tmp/packages', just use this command:
tidy-rpm-cache.py --dir=/tmp/packages
It'll give you a list of the old packages it found and ask if you're sure about deleting them. If you're ready to go without confirmation, just add the --force option!
You can set it up to keep a certain number of older versions too! For example, if you want to keep one old version in case something goes wrong with the new one, use:
tidy-rpm-cache.py --dir=/tmp/packages --num-obsolete=1
If there are specific packages you don't want to delete, use a regular expression for that. For instance, if you want to skip all kernel packages, run:
tidy-rpm-cache.py --dir=/tmp/packages --exclude='^kernel.*'
(Remember to put those regex patterns in single quotes!)
If you're curious about what the script is doing or what it's checking, just add the --verbose option. And if things get too noisy, --quiet will silence most messages except for warnings and errors.
This script fills a gap left by YUM—an RPM-based software manager that keeps downloaded files but doesn't remove outdated ones. You could set up a cron job with this command for regular cleanups:
tidy-rpm-cache.py --dir=/var/cache/yum --force
If you're ready to try it out or need more details on how everything works, check out this Tidy RPM Cache Script.
Go to the Softpas website, press the 'Downloads' button, and pick the app you want to download and install—easy and fast!
SoftPas is your platform for the latest software and technology news, reviews, and guides. Stay up to date with cutting-edge trends in tech and software development.
Subscribe to newsletter
© Copyright 2024, SoftPas, All Rights Reserved.