# How to upload .deb files using the jenkins pipeline and your credentials to the Nexus OSS

**URL:** <https://community.sonatype.com/t/how-to-upload-deb-files-using-the-jenkins-pipeline-and-your-credentials-to-the-nexus-oss/7010>\
**Category:** Best Practices\
**Tags:** nexus-repository\
**Created:** [July 27, 2021, 12:38pm UTC](https://community.sonatype.com/t/how-to-upload-deb-files-using-the-jenkins-pipeline-and-your-credentials-to-the-nexus-oss/7010 "2021-07-27T12:38:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sobrito](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/sobrito/32/1954_2.png) [@sobrito](https://community.sonatype.com/u/sobrito)\
**Post date:** [July 27, 2021, 12:38pm UTC](https://community.sonatype.com/t/how-to-upload-deb-files-using-the-jenkins-pipeline-and-your-credentials-to-the-nexus-oss/7010/1 "2021-07-27T12:38:14Z")

</div>

I I’m trying to use the Nexus repository to manage \*.deb packages generated by jenkins, but when trying to upload these packages to nexus I’m getting a lot of errors, what is the best way to publish the packages in deb format that are in jenkins to a nexus repository apt, using the jenkins credential management mechanism to authenticate?

Using “Nexus Repository Manager Publisher” the apt repository does not appear, only maven repositories appear.

Tentei usar os seguintes scripts de pipeline:

```auto

withCredentials([usernamePassword(credentialsId: '3e4ea258-4b41-4379-a0fe-4462ed3e420a', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USERNAME')]) {
  sh '''
	for i in `/workspace/*.deb`
	do
		echo "Sending $i\r\n"
		curl -u \"$NEXUS_USERNAME:$NEXUS_PASSWORD\" -H "Content-Type: multipart/form-data" --data-binary \"@/$i\" "http://10.224.50.202:8081/repository/nerd4ever-labs/"
	done
  '''
}

withCredentials([usernamePassword(credentialsId: '3e4ea258-4b41-4379-a0fe-4462ed3e420a', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USERNAME')]) {
  sh '''
	for i in `/workspace/*.deb`
	do
		echo "Sending $i\r\n"
		curl -u $(NEXUS_USERNAME):$(NEXUS_PASSWORD) --upload-file $i "http://10.224.50.202:8081/repository/nerd4ever-labs/"
	done
  '''
}

```

With the above pipelines I get the error:

```auto
: Syntax error: newline unexpected

```

It’s my first contact with the Sonatype Nexus Repository Manager, I’m using an OSS 3.32.0-03 version.

I plan to use it for apt (debian), yum (centos) and poudriere (freebsd) and composer packages, but I’m struggling with the basics.

I’ve already set up the apt repository.

---

<div class="post-metadata">

**Author:** ![koneru.pa1](https://avatars.discourse-cdn.com/v4/letter/k/b5ac83/32.png) [@koneru.pa1](https://community.sonatype.com/u/koneru.pa1)\
**Post date:** [April 5, 2024, 5:27pm UTC](https://community.sonatype.com/t/how-to-upload-deb-files-using-the-jenkins-pipeline-and-your-credentials-to-the-nexus-oss/7010/2 "2024-04-05T17:27:40Z")

</div>

I am facing a similar issue. Did you sign the packages before uploading them?
