A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Package Manager' started by JimmyCushnie, May 6, 2018.
Is there any way to configure where packages are downloaded to and stored?
Thanks for the feedback. Unfortunately we don't currently support the option to change the default package cache on your system but I'll take note of the request and see what we can do for a future release.
Please keep the feedback coming.
Please make this a priority. Ever since the introduction of the AssetStore developers have been requesting the ability to specify the location of asset package downloads to no avail. Personally I despise that assets ( data ) are 'polluting' my C drive, especially as its only a 256Mb SSD where the cost of space is at a premium. I already have over 4GB of asset store packages and no doubt the new package cache itself will soon balloon in file size too. Being able to specify it use a location on my 2TB other drive would be so much better.
Also in terms of features i'm wondering if a nice inbuilt back up system would be beneficial. I already make back ups of asset store packages by hand, and just completing an editor tool to do this automatically. Simple reason being that internet connection is not a given, even in the UK periodically I lose internet in off hours while the ISP does updates or housekeeping. In addition as much of my client work involves installing on-site and sometimes needing to make updates, having local back ups of older versions would be a nice safety net.
Thanks for the feedback as well. Re: Customizing the package cache location. In the short term, it will hopefully not be a major issue even with a small local HD since the number of new ackages and overall size is relatively small. However, yes it's definitely an important point for us to address moving forward as we onboard more packages internally and from 3rd parties.
Re: backup system. It's noted and I'll review with the team. Are you looking for something along the lines of a "Project" backup/archive or more system wide in terms of Packages?
I think more global in nature, just so you can easily have backup of packages to take onsite, or be able revert to earlier versions etc. Again most beneficial when the internet might be unavailable, or as is often the case onsite can be intermittent or low bandwidth.
Just found this as I was about to post the same request.
I think it is important to have a setting for where things are installed and downloaded. It especially applies for users with SSDs. This includes:
Asset Store Local Packages: most people don't want that on C:, since some packages are huge (I've downloaded several GB in size) and it is not clear if these folders are safe to delete. Unity should consider a UI window for this, with the ability ton change the path and delete the cached packages from the UI.
Package Manager packages. With multiple versions and 3rd party packages this will become important too, since we can't actually erase those like we could with Asset Store Packages Cache now.
Place where new Unity Versions are installed with Unity Hub. Some versions we want in the default (preferred) path, presumably on C:, and some we don't. So, for example in my case, main project Unity version will go on C:, betas and legacy support versions will not. One solution would be to offer a list of install locations defined by the user, and for every new installation if there is more than one install location defined we should pick which one we want for this specific version. As it is today, it is actually more convenient to not use Unity Hub, since we can at least manually choose where things are installed.
I usually solve this with symlinks. Occasionally an app may have really terrible symlink support and screw everything up, but that’s pretty rare on macOS and Linux.
Moreover, this violates a software development tenet: Ideally, all code dependencies (with possible exception of platform/sdks) reside under source control for a given project. It is often the case that third party code is modified/fixed. It's ok to have a (optional) cache in the User's profile folder, but packages referenced by projects need to live under the project folder or at the least, we need an option to reference/download them there. If this isn't already implemented, please prioritize.
FWIW, SymLinks(Junctions, reparse points, etc.) can burn you. In particular, the new (forced) Windows Feature Pack updates are not simple in-place patches. They are clean Windows installations with user migration. Problem is that they often won't respect your junctions, particularly in Program Files and Program Files (x86) and other 'system' folders. Your content might be orphaned and junction obliterated, or Windows setup could fail completely (over and over and over and over). The constrained SSD C: problem is something the Windows and Visual Studio groups are aware of and they are taking some steps to try to change things, but it's not easy. So, be aware and careful if redirecting special system folders.
Maybe that's a problem unique to Windows. The other platforms supported by Unity treat symlinks as whatever they're pointing to.
It's not a problem with reparse point implementation on Windows. It functions similarly to other OS'es in that respect. Windows setup, during major feature upgrade (with user migration) deletes them and re-creates them as simple directories, because it is not checking if they are reparse points and doesn't re-create them as such.
It's the one and only reason we don't buy Unity... not even a safe workaround.
> In the short term, it will hopefully not be a major issue even with a small local HD since the number of new ackages and overall size is relatively small.
I've just checked and the cache directory was 2.5Gb
May I suggest this is now a high priority?
Mine is ~1Gb right now but I clear it up from time to time. My SSD is 128Gb, and there's usually only about 10Gb of free space available.
Thank you for remembering us the importance of this issue . I just did a reprioritization of our backlog to make sure this feature related stories are as high as possible.
In the meantime, I added a sticky post that shows you how you can, today, configure the Unity Package Manager global caches location: https://forum.unity.com/threads/configure-unity-package-manager-global-cache-location.650245/
Hope this will help,
Hmm I missed this update, but glad I checked as my cache is now sitting at 7 GB!
Packages are 3.7 GB and npm is 3.3 GB.
Looks like i'm being punished for being early adopter and experimenting with new packages and that I regularly switch between multiple versions of Unity.
So let me see if I've got this right.
I can delete both npm and package folders from the cache and face no consequences, other than Unity having to download and decompress packages on demand on a per project basis?
I can delete packages folder and will NOT lose any package data as the compressed versions live in npm folder. Thus there is no risk and only downside is that Unity will have to decompress packages on demand per project.
As for the future, the explosive growth of the cache would indicate that Unity needs to take steps to address the problem. Maybe some efforts have already been made, but as of 2018.4 I couldn't find any means to clear the cache at all, let alone in an intelligent way.
What I think we need
A means of clearing the cache from within Unity ( preferences ) with options to
Clear all - explain danger of losing npm versions.
Clear packages only - and explain there is no danger of data loss.
Ideally we'd then have filters on top of this to
Clear by date.
Clear non-verified packages if a verified package exist.
Clear oldest previews.
In addition it would be great to add additional support along the lines of adding a file to the cache that will track package usage by project name. This would provide a means for users to examine on a per package version basis the frequency of its use and which specific projects. That way they can be more informed in terms of deciding whether to delete npm packages or not.
Thinking about it perhaps working in reverse of the last paragraph might be better, that in a project you can via the package manager mark all the used packages as 'essential'. This will then store this information in a database that all the packages in this project must be kept and never removed via 'Cache clearing'. The database entry will be kept in sync with the project so it will track changes to packages or versions used.
Has this been fixed? i have 0 bytes left on my c:/
Litterally cant work on the project now
Hi @Dostac ,
The only way to configure the Package Manager global cache location, for now, is through environment variables. See the documentation for more details.
Make sure to restart the Hub and Unity to get the en var properly propagated.
Heya just wanted to add to this: Now that the package manager also downloads assetstore purchases there should definitely be some way to change this folder's location via UI. Just got confused for about 2h because I couldn't figure out why Unity wouldn't let me extract a package (C:// volume full)
Just FYI, I think I filed a report for the issue like 6 years ago; and I was told "we are looking into it".
Not sure what is so hard in implementing a simple path string for the packages; I can have projects saved wherever I want. and same for my GI cache, so the same should go for packages from the store. I find excessive to ask me to create a symlink to another drive, just because there is no option to specify the packages cache, except in your main drive.
It is one of those low-hanging fruits that takes very little to be put in place, and it has quite a large impact for many users that like to work offline and have their whole asset library with them.
Also imagine the case where you replace your main drive... you need to download everything again, while you could simply point Unity to the external drive location.
My assets library from the store is quite large; not sure about everyone else, so that would really be a useful thing to have.
Just adding my "Yes please" to this. Currently fighting my UserData Partition because it's years old and getting too small.
Just a note that I've sent over the most recent responses to the team to see if I can get a response on this.
I hope this helps everyone!
I agree this feature sounds like a good bang for the buck. I have checked with product management and unfortunately I cannot commit to anything regarding our roadmap but I can tell you we're aware of the issue.
The solution for now is to use Symbolic Links. They are like shortcuts, except windows recognises them as the actual folder.
Get this shell extension. The website looks like it's from 1998, so you know the software works.
Create two folders on your desired hard drive, such as E:\Unity\AppDataLocal and AppDataRoaming. Note: Some unity folders have stupidly long names, so make this folder near your root.
Cut + Paste the Unity folder from C:\Users\_Username_\AppData\Local\Unity to E:\Unity\AppDataLocal.
When finished, right-click-drag the Unity folder back into C:\Users\_Username_\AppData\Local and choose Drop Here > Symbolic Link. Note: You will need two windows open for this, or, alternatively, I think you can cut+paste the symbolic link anywhere you want after creation.
Repeat for the stuff in C:\Users\_Username_\AppData\Roaming\Unity.
Now you have saved 7GB+
Other spam you might want to move:
AppData\Roaming\Unity Hub (with a space this time).
Drop Here > Symbolic Link