yum-utils RPM에서 "repomanage"유틸리티를 확인하십시오. 원하는 것을 정확하게 수행합니다.
[root ~]# repomanage --help
usage:
repomanage: manage a directory of rpm packages. returns lists of newest
or oldest packages in a directory for easy piping to xargs
or similar programs.
repomanage [--old] [--new] path.
options:
-h, --help show this help message and exit
-o, --old print the older packages
-n, --new print the newest packages
-s, --space space separated output, not newline
-k KEEP, --keep=KEEP newest N packages to keep - defaults to 1
-c, --nocheck do not check package payload signatures/digests
[root ~]#