CleanMate

All guides · macOS and Ubuntu · Updated

Unity using too much disk space: old Editor versions in Unity Hub, caches and project Library folders on Mac and Ubuntu

Where Unity Hub installs Editor versions on a Mac and on Ubuntu, how to remove old ones safely, which Unity caches you can clear, and when to delete a project Library folder.

Download for macOS · Install on Ubuntu — free and open source

CleanMate on Ubuntu asking before it cleans Unity caches and other developer junk, with each item and its size

Unity fills a disk in three places. Each Editor version Unity Hub installs takes 5 to 15 GB, and Hub keeps every version side by side. Unity’s caches hold packages and Asset Store downloads. And every project has a Library folder, often 2 to 20 GB, that Unity builds from your assets.

What is safe to delete

What Where Safe?
Old Editor versions Mac /Applications/Unity/Hub/Editor/<version>, Ubuntu ~/Unity/Hub/Editor/<version> Yes, if no project still uses that version
Package cache Mac ~/Library/Unity/cache, Ubuntu ~/.config/unity3d/cache Yes, downloaded again
Asset Store downloads Mac ~/Library/Unity/Asset Store-5.x, Ubuntu ~/.local/share/unity3d/Asset Store-5.x Yes, download them again from My Assets
A project’s Library, Temp, Logs, obj inside the project Yes, with the project closed; the next open re-imports everything
A project’s Assets, Packages, ProjectSettings inside the project No, this is your project
Licenses Mac ~/Library/Unity/Licenses No
Game saves Ubuntu ~/.config/unity3d/<Company>/<Product> No, these are saved games

Old Editor versions

Check which version each project uses: it is in the project’s ProjectSettings/ProjectVersion.txt (m_EditorVersion), and Unity Hub shows it in the Projects list. Then remove the others in Unity Hub: Installs, the gear (or ⋯) next to a version, Uninstall. Hub removes the folder and forgets the version.

To see what is installed and how big:

du -sh /Applications/Unity/Hub/Editor/*   # Mac
du -sh ~/Unity/Hub/Editor/*               # Ubuntu

If you changed the install location in Unity Hub (Preferences › Installs), the editors are there instead. A version you remove can be installed again from Hub’s Installs page, or from the Unity download archive for an older one.

Unity caches

Quit Unity and Unity Hub, then:

# Mac
rm -r ~/Library/Unity/cache
rm -r ~/Library/Unity/"Asset Store-5.x"
# Ubuntu
rm -r ~/.config/unity3d/cache
rm -r ~/.local/share/unity3d/"Asset Store-5.x"

Do not delete ~/.config/unity3d itself on Ubuntu: Unity games save their progress in folders under it.

The project Library folder

Library holds the imported version of every asset. Unity builds it again when you open the project, which can take from minutes to an hour on a big project. It is worth deleting for projects you rarely open, or when an import is broken. Close the project in Unity, then from the project folder:

rm -r Library Temp Logs obj

These folders should not be in version control; the usual Unity .gitignore excludes them.

How CleanMate does it

On Ubuntu 2.2.0 and from macOS 1.6, CleanMate lists Unity in Smart Scan under developer junk (all macOS features, all Ubuntu features):

CleanMate does not delete project Library folders: use the command above. Build folders of other project types are covered in old node_modules and build folders; Android SDK versions Unity’s Android builds use in Android Studio disk space.

FAQ

Can I delete an Editor version a project uses? Yes, but opening that project then asks you to install it again or to upgrade the project, which can change it.

Will deleting Library lose my work? No. Your scenes, scripts and assets are in Assets; Library only holds what Unity built from them.

Skip the commands

CleanMate runs on both systems: pick yours.

Open source — star it on GitHub: CleanMate for macOS · CleanMate for Ubuntu

How CleanMate decides what is safe to remove →