This article will provide a solution for searching all artifacts in a repo except the latest 2 versions based on their names, irrespective of created date and download history. For example, using this method, I can retrieve the RPM packages
rpm-4.18.1-3-omv2390.x86_64.rpm
rpm-4.18.2-3-omv2390.x86_64.rpm
rpm-4.18.3-3-omv2390.x86_64.rpm
which are older versions.rpm-4.18.2-3-omv2390.x86_64.rpm
rpm-4.18.3-3-omv2390.x86_64.rpm
This solution can be applied to maven, npm, nuget, debian, rpm, python, gems.