Use rpmvercmp for more accurate version comparison instead of sort -n. Fallback to sort -n if rpmvercmp is not available.