How to replace an existing package in the Octopus repository?

How can I replace an existing package when pushing with nuget.exe to the Octopus repository? I get a 400 Bad Request if the package of that version exists; the UI allows me to replace a pre-existing version when uploading, how can I achieve this when automating the process?

Hi David,

Thanks for getting in touch! Unfortunately the 400 error is returned by NuGet.exe itself. The UI uses a different upload mechanism that we can control, but we cannot stop NuGet.exe from providing this error when the file already exists. Is there a reason you are replacing an existing package or is it more a case of your process trying to push a package on each build?

Vanessa

Hi Vanessa,

It’s a case of my automated process trying to push the package, especially if it failed part way through; I try to rerun the automated process and it resubmits the package, and bang, 400!

I have the same issue with an automated deployment process of a solution using visual studio online. After the build, I have 2 projects that are deployed using octopack. Is there a way to force override existing packages through the command line? Thank you.