Safe complete uninstall of older Meteor installations

I just found I have a good bunch of installations and they all point to their own global NPM dependencies:

$ ls -AgGhv --time-style=+"" ~/.meteor/packages/meteor-tool/ | grep "\->"
lrwxrwxrwx 1   62  1.4.0-1 -> .1.4.0-1.61jonm.4iwhb++os.linux.x86_64+web.browser+web.cordova
lrwxrwxrwx 1   62  1.4.1_1 -> .1.4.1_1.1dxqyx6.eqyo++os.linux.x86_64+web.browser+web.cordova
lrwxrwxrwx 1   62  1.6.0_1 -> .1.6.0_1.gzfkxy.gs7wt++os.linux.x86_64+web.browser+web.cordova
lrwxrwxrwx 1   60  1.6.1 -> .1.6.1.1ahe2cb.dzd5++os.linux.x86_64+web.browser+web.cordova
lrwxrwxrwx 1   81  1.7.0_5 -> .1.7.0_5.va9fch.3rqhm++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   81  1.8.0_1 -> .1.8.0_1.10701cy.wos2++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   80  1.8.0_2 -> .1.8.0_2.1om3lwx.sy8++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   80  1.8.1 -> .1.8.1.1ptrv4e.jlf9j++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   79  1.8.3 -> .1.8.3.oytqbq.h8oeh++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   79  1.9.0 -> .1.9.0.1tywdi.8bbkq++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   78  1.9.1 -> .1.9.1.kqk4oz.5o1w++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   79  1.9.2 -> .1.9.2.16uftia.x701++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   80  1.10.1 -> .1.10.1.140xeb9.tm6q++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   79  1.10.2 -> .1.10.2.uk34tu.y7nu++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   80  1.11.0 -> .1.11.0.qpxal2.gcn3n++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   81  1.11.1 -> .1.11.1.1ya5b3a.s696k++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   80  1.12.0 -> .1.12.0.1owpfpv.80is++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   81  1.12.1 -> .1.12.1.1kb11wz.gdupf++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   79  2.0.0 -> .2.0.0.tw0n3k.cn868++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   79  2.1.0 -> .2.1.0.1un6ars.rthn++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   79  2.1.1 -> .2.1.1.56bx6s.gu3us++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova

Size became also quite big

$ du -sm ~/.meteor/packages/meteor-tool/
9744    /home/username/.meteor/packages/meteor-tool/

I’d like to clean everything before 1.9 but I am not 100% sure, whether I can safely uninstall any of the older versions that easily, for example using rm -rf. Before messing around I’d like to ask, if anyone already attempted the same thing?

I’ve never selectively removed stuff, but I have removed the entire ~/.meteor directory. Meteor just re-downloads everything you need (including a Meteor distribution, if necessary) as soon as you next run meteor.

Thanks @robfallows this will by my last-resort option :slight_smile:

Before hitting the red button however :boom: , I would like to keep the latest versions, so I don’t have to re-download and re-build. I just checked in the ~/.meteor/packages and I wonder by which logic these “global” packages are cached. For example compared to the list above the accounts-base package is only listing a subset of releases (allthough used in projects with 2.x releases):

$ ls -AgGhv --time-style=+"" ~/.meteor/packages/accounts-base/ | grep "\->"
lrwxrwxrwx 1   42  1.2.9 -> .1.2.9.1beyahv++os+web.browser+web.cordova
lrwxrwxrwx 1   47  1.4.0 -> .1.4.0.10h1ifx.whkx++os+web.browser+web.cordova
lrwxrwxrwx 1   48  1.4.2 -> .1.4.2.1gdwnz.awhhph++os+web.browser+web.cordova
lrwxrwxrwx 1   66  1.4.3 -> .1.4.3.npqsci.50m1m++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.4.4 -> .1.4.4.186tc9.xljs1++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.4.5 -> .1.4.5.z47v5o.myozm++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.5.0 -> .1.5.0.ro5v34.zdwvq++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.6.0 -> .1.6.0.198baxh.k3aw++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.7.0 -> .1.7.0.uqpr6v.q940p++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   64  1.7.1 -> .1.7.1.zrki64.xta++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   65  1.8.0 -> .1.8.0.qa9mi8.n7sp++os+web.browser+web.browser.legacy+web.cordova

or accounts-password:

ls -AgGhv --time-style=+"" ~/.meteor/packages/accounts-password/ | grep "\->"
lrwxrwxrwx 1   43  1.2.12 -> .1.2.12.1ca8668++os+web.browser+web.cordova
lrwxrwxrwx 1   47  1.5.0 -> .1.5.0.j7dj9e.2sfl7++os+web.browser+web.cordova
lrwxrwxrwx 1   47  1.5.1 -> .1.5.1.1llc4nt.6t5i++os+web.browser+web.cordova
lrwxrwxrwx 1   66  1.5.2 -> .1.5.2.12d5a9v.sjax++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.5.3 -> .1.5.3.8auwcd.gzd39++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.6.0 -> .1.6.0.r3c14r.kv74g++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   65  1.6.1 -> .1.6.1.m2qctl.1jfd++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   67  1.6.2 -> .1.6.2.1n3zxg4.lxeji++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.6.3 -> .1.6.3.o6ok4b.2xaob++os+web.browser+web.browser.legacy+web.cordova
lrwxrwxrwx 1   66  1.7.0 -> .1.7.0.15epagq.fv5d++os+web.browser+web.browser.legacy+web.cordova

We’re using this old package for this:

And calling this in our CI:

clean-package-cache --keep-latest 4 --yes

So far works like a charm keeping our pipeline EC2s and local dev environments lean.

1 Like