Developers · NuGet package cache

Is it safe to delete the NuGet packages folder on Mac?

Safe to removeComes back on its own
~/.nuget/packages

Updated October 17, 2026By the MoreRoom team, Yando Pte. Ltd.This page as Markdown

The short answer

Yes. Rebuilt or re-downloaded automatically when needed.

What is it?

~/.nuget/packages is NuGet’s global packages folder: every package version restored by dotnet restore, dotnet build or your IDE, shared by all .NET projects. Old versions are never removed automatically, so it often reaches several gigabytes.

What happens if you delete it?

Packages are downloaded again on the next restore, which takes time and bandwidth. Projects build normally afterwards.

How to remove it properly

Run dotnet nuget locals all --clear in Terminal, the official command, which also clears NuGet’s HTTP and temporary caches and deletes permanently. To empty only this folder, use dotnet nuget locals global-packages --clear.

Use the tool’s official command: dotnet nuget locals all --clear

Before you delete it

Close Visual Studio Code, Rider or any running build first, since files in use cannot be removed.

How MoreRoom helps

MoreRoom recognises this item, shows its real size and when it was last used, and labels it “Safe to remove”. In the free version you can move it to the Trash in one click, with Undo; Pro collects every safe item at once.

When the tool is installed, MoreRoom runs its official command for you (dotnet nuget locals all --clear) instead of deleting files — and tells you that this step can’t be undone.

Frequently asked questions

Is it safe to delete the NuGet packages folder on Mac?

Yes. Rebuilt or re-downloaded automatically when needed. Packages are downloaded again on the next restore, which takes time and bandwidth. Projects build normally afterwards.

Will NuGet package cache come back after I delete it?

Yes. Packages are downloaded again on the next restore, which takes time and bandwidth. Projects build normally afterwards.

How do I remove NuGet package cache properly?

Run dotnet nuget locals all --clear in Terminal, the official command, which also clears NuGet’s HTTP and temporary caches and deletes permanently. To empty only this folder, use dotnet nuget locals global-packages --clear.

Guides that mention it

Related folders