Can't upload a large DEB package to Nexus

Hi guys,

Nexus version: 3.41.0-01

Can’t upload a large deb package to the Nexus APT repository using curl

curl -u "admin:admin" -H "Content-Type: multipart/form-data" --data-binary "@./my.deb" https://.../repository/deb-repo/

curl: option --data-binary: out of memory

Second method:

curl -u "admin:admin" --upload-file "my.deb" -X PUT https://.../repository/deb-repo/

Expect: 100-continue

TLSv1.2 (IN), TLS header, Supplemental data (23):
Mark bundle as not supporting multiuse
HTTP/1.1 405 PUT
Strict-Transport-Security: max-age=7776000
Server: Nexus/3.41.0-01 (OSS)
X-Content-Type-Options: nosniff
Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
X-XSS-Protection: 1; mode=block
Allow: GET,HEAD,POST
Connection: close

curl -u "admin:admin" --upload-file "my.deb" -X POST https://.../repository/deb-repo/


Method Not Allowed

Thanks in advance

1 Like

Hi,

Did you find a solution? I have the same problem with 3.51.0-01.

Regards

After hours of research, I found a solution. I’m posting here if it can help anyone else.

Use this command:

curl -u "<user>:<password>" -fail -X POST "http://<ip address>:8081/service/rest/v1/components?repository=your-respository-name" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "apt.asset=@your-package.deb"

User must have a role with following privileges:
nx-repository-view-apt-*-add, nx-repository-view-apt-*-read and nx-repository-view-apt-*-edit

If you have timeout error when uploading large files, you can edit the Jetty configuration for the idleTimeout to increase the value (default is 30000):

For docker image, you can do:

docker exec -u 0 -it nexus /bin/bash
sed -i 's/<Set name="idleTimeout"><Property name="jetty.http.timeout" default="30000"\/><\/Set>/<Set name="idleTimeout"><Property name="jetty.http.timeout" default="300000"\/><\/Set>/g' /opt/sonatype/nexus/etc/jetty/jetty-http.xml

Regards,