I have a FTP server which I use for Linux repository for RPM packages. I need to delete old packages without doing it manually. Is there a script which can delete old packages based on package version?
Best wishes
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you can run on the server side:
Depending on your favorite programming language, you can compare rpm versions with Perl or Python.
You can gather some ideas here:
https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch17s03s06.html and
http://metacpan.org/pod/RPM2 (Perl, package RPM2; provides a <=> operator for comparing versions)
other CPAN modules: http://search.cpan.org/search?query=RPM&mode=all
Compare RPM Packages using Python https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-rpm-programming-python.html http://www.sharms.org/blog/2009/05/python-rpm/ (Python, package rpm)
If you can’t run on the server side, things become a little hairy, because all the naming/versioning schemes are difficult to tell apart.