Description
Reproduce case:
Upload two rpm's which have the same artifact ID but different versions into a hosted yum repository in Nexus Repo 3.13.0. I've attached the two i used in testing to make this easy to reproduce.
curl --upload-file my-webapp2-3.1.4-1.noarch.rpm http://localhost:8081/repository/platform-centos7/my-webapp2-3.1.4-1.noarch.rpm -u admin:admin123 -v
curl --upload-file my-webapp2-3.1.5-1.noarch.rpm http://localhost:8081/repository/platform-centos7/my-webapp2-3.1.5-1.noarch.rpm -v -u admin:admin123
Wait for yum metadata to be generated, then verify both versions are in the primary.xml.gz file.
Delete the newer version via rest:
curl -X DELETE http://localhost:8081/repository/platform-centos7/my-webapp2-3.1.5-1.noarch.rpm -v -u admin:admin123
Request.log will show it has been successfully deleted:
127.0.0.1 - admin [07/Sep/2018:16:52:21 -0500] "DELETE /repository/platform-centos7/my-webapp2-3.1.5-1.noarch.rpm HTTP/1.1" 200 - 0 6 "curl/7.54.0"
The nexus.log shows the yum metadata rebuilds 60 seconds later:
2018-09-07 16:53:21,255-0500 INFO [event-9-thread-32] admin org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl - Rebuilding yum metadata for repository platform-centos7
2018-09-07 16:53:21,330-0500 INFO [event-9-thread-32] admin org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl - Finished rebuilding yum metadata for repository platform-centos7
Download the primary.xml.gz file, and observe both versions are still listed:
<?xml version="1.0" ?> <metadata packages="1" xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm"> <package type="rpm"> <name>my-webapp2</name> <arch>noarch</arch> <version epoch="0" rel="1" ver="3.1.5"/> <checksum pkgid="YES" type="sha256">8a1f6e2706b17eced9c1772e9188e76a9bd82b61832cf0779afd844493ad5f6a</checksum> <summary>my-webapp Maven Webapp</summary> <description/> <packager/> <url/> <time build="1536356865" file="1536357136192"/> <size archive="1391680" installed="1388980" package="1261996"/> <location href="my-webapp2-3.1.5-1.noarch.rpm"/> <format> <rpm:license>EPL</rpm:license> <rpm:vendor/> <rpm:group>Applications/Internet</rpm:group> <rpm:buildhost>unknown001c426fe22e.attlocal.net</rpm:buildhost> <rpm:sourcerpm>my-webapp2-3.1.5-1.src.rpm</rpm:sourcerpm> <rpm:header-range end="3636" start="280"/> <rpm:provides> <rpm:entry epoch="0" flags="EQ" name="my-webapp2" rel="1" ver="3.1.5"/> </rpm:provides> <rpm:requires> <rpm:entry name="tomcat6"/> </rpm:requires> </format> </package> <package type="rpm"> <name>my-webapp2</name> <arch>noarch</arch> <version epoch="0" rel="1" ver="3.1.4"/> <checksum pkgid="YES" type="sha256">af0c577d387d7e19ec4d879598a2ff01e75faa5bc8fb7de83777ec00dcccbdc5</checksum> <summary>my-webapp Maven Webapp</summary> <description/> <packager/> <url/> <time build="1505234336" file="1536357015963"/> <size archive="1391680" installed="1388980" package="1261996"/> <location href="my-webapp2-3.1.4-1.noarch.rpm"/> <format> <rpm:license>EPL</rpm:license> <rpm:vendor/> <rpm:group>Applications/Internet</rpm:group> <rpm:buildhost>unknown001c42591e81.attlocal.net</rpm:buildhost> <rpm:sourcerpm>my-webapp2-3.1.4-1.src.rpm</rpm:sourcerpm> <rpm:header-range end="3636" start="280"/> <rpm:provides> <rpm:entry epoch="0" flags="EQ" name="my-webapp2" rel="1" ver="3.1.4"/> </rpm:provides> <rpm:requires> <rpm:entry name="tomcat6"/> </rpm:requires> </format> </package> </metadata>