You can clear the .nuget\packages directory under your user profile, however packages will be downloaded again if you install them again.
Package Search
%USERPROFILE%\.nuget\packages is the local computer cache used by NuGet v3 when installing NuGet packages for new types of projects, such as Universal Windows projects.
For a C # console project, NuGet will use the %LOCALAPPDATA%\NuGet\Cache directory, which also uses NuGet v2.
ASP.NET Core projects currently use their own %USERPROFILE%\.dnx\packages for NuGet packages.
Specifying a Custom NuGet Package Location
To prevent NuGet from copying packages to your user profile, you can create a new environment variable %NUGET_PACKAGES% , indicating the place where you want NuGet to copy files, for example. C:\git-repositories\.nuget\packages .
To prevent NuGet from copying packages to the solution folder, you can also create a new NuGet.config file either in the solution folder or at any higher level to the root. You can specify the following XML as content.
<?xml version="1.0" encoding="utf-8"?> <configuration> <config> <add key="repositoryPath" value="C:\git-repositories\.nuget\packages" /> </config> </configuration>
For help with configuration inheritance, go to this link: NuGet Inheritance Inheritance
source share