Why are old versions of packages retained?


Here is a part of console IO showing that I have a big .apm full of old package versions. Why?

[07:04] ~/.atom$-->  du -sh
1.6G	.
[07:04] ~/.atom$-->  cd .apm
[07:04] ~/.atom/.apm$-->  du  -sh
441M	.
[07:04] ~/.atom/.apm$-->  cd ..
[07:04] ~/.atom$-->  du -sh *
9.8M	blob-store
41M	compile-cache
8.0K	config.cson
4.0K	github.cson
4.0K	init.coffee
4.0K	keymap.cson
0	nohup.out
915M	packages
4.0K	projects.cson
216K	recovery
4.0K	snippets.cson
4.0K	split-diff
8.0K	storage
8.0K	styles.less
4.0K	terminal-commands.json
[07:04] ~/.atom$-->  tree -L 1 .apm/nuclide
β”œβ”€β”€ 0.220.0
β”œβ”€β”€ 0.221.0
β”œβ”€β”€ 0.222.0
β”œβ”€β”€ 0.223.0
β”œβ”€β”€ 0.226.0
β”œβ”€β”€ 0.228.0
β”œβ”€β”€ 0.229.0
β”œβ”€β”€ 0.230.0
β”œβ”€β”€ 0.231.0
β”œβ”€β”€ 0.232.0
β”œβ”€β”€ 0.241.0
β”œβ”€β”€ 0.242.0
β”œβ”€β”€ 0.243.0
β”œβ”€β”€ 0.244.0
β”œβ”€β”€ 0.245.0
β”œβ”€β”€ 0.247.0
β”œβ”€β”€ 0.249.0
β”œβ”€β”€ 0.250.0
β”œβ”€β”€ 0.252.0
β”œβ”€β”€ 0.254.0
β”œβ”€β”€ 0.255.0
β”œβ”€β”€ 0.256.0
β”œβ”€β”€ 0.257.0
β”œβ”€β”€ 0.258.0
└── 0.259.0

25 directories, 0 files
[07:05] ~/.atom$--> 

I chose nuclide as typical. Obviously there is a whole forestful of similar trees.


It’s funny you mention this, because only minutes ago I have asked myself why it’s necessary to keep thousands of entries for old package versions in Atom’s localStorage. Just mentioning this, since it’s possibly related.



The .apm directory is apm’s cache, so those are packages stored locally so you don’t have to download them if you reinstall them. You can delete the whole directory and apm will recreate it and just add versions that you download after.
It would be nice to have better control over the cache, like a configure option to limit its size, or clean out older versions, but I haven’t found anything like that.


I understand the concept but I question the usefulness of the historical pile. Keeping the package as downloaded can have some utility.

Debian’s version control system (apt is a part of it) does the same thing. But it provides commands to prune the ever growing cache.

Why would I want to reinstall any of the (for instance) superseded 11 versions of file-icons or 28 versions of language-babel? I dunno. I guess I am grateful for the possibility.

I agree - I’d would like a safe way of removing the cruft. OTOH there are lots of things about atom that should be higher priority than that :slight_smile:


Atom is so open that this could even be a community package. Some kind of power-user package management panel that’s accessible via a keybinding (one click to get there instead of two to get to Settings -> Packages) and has batch enable/disable along with cache control?


I have recently released a very basic package that deletes recent package-versions (in the settings, you can specify the last n versions you wish to preserve). It works fine, but I’m planning to improve it over the next couple of weeks.


  • asynchronous code
  • better storage deletion
  • interval option for automatic cleanup

Until then, please give it a try!