Unable to delete NuGet package on server

By | September 29, 2015

Today I was trying to clean up some old packages from the Nuget server. And this happened. Nuget delete command failed to delete packages from the Nuget Server. The nuget server I am talking about is the local one which I configured.

Deletion was failing for me despite the documentation saying that is should succeed.

I was getting errors like this:

I finally nailed it down to the permissions on the packages in the Packages folder. (This folder is usually under Server folder in your Nuget Server install. Unless you have changed the web.config to make some other folder as your package destination.)

It was “Read” and “Read and Execute” for normal users.
Just for testing I used the “Full Control” sledgehammer.
And it worked.

And of course before I am blasted for deleting packages from the Nuget server I will make it clear that it was Beta packages I was cleaning up.
And yes, rather than just deleting them, I move them to a separate folder on my server. Delisting is also an option though users can install the delisted packaged via commandline.

Hopefully it saved you sometime.

Leave a Reply