Remove/Uninstall pkgs from bloated drive

My devops team is complaining about the amount of data being taken up on the server where I am keeping my Habitat build environment. Are there any pkgs I can remove/uninstall from either /hab/pkgs/core or hab/pkgs/{some other location} and how do I know which might be safe to remove. I inherited the system from a colleague who has left the company and only left rudimentary instructions on how to use Habitat.

As an additional note:

I am seeing a number of folders at {installation}/docker/overlay2 which contains the /hab/pkgs/core and hab/pkgs/{build} package files. Each day we build, it appears to download 503M of data. These files are not going away, and it is impacting the performance of other projects on the server. Thank you for any assistance.

Hi, hab has an uninstall feature with a dry-run.

hab pkg uninstall <pkg/ident>

I believe the dry-run flag is -r. Of course you can just pass --help flag. The uninstall command would allow you to remove some of the old stuff that is if you know what those are.

Just to be clear are you trying to remove files from the build phase? Or are you trying to remove packages once they have been deployed?

This is definitely post build. We have hab installed on our test server cloud instance and my colleague put it on the root so that if we got rid of volumes, we would not loose it. Unfortunately the files deep in the hab folder are taking up to 90% of our root disk space. If they are safe to remove I would like to or if there is some step I can add to our build phase…
Thanks for the assistance.

Thanks for the help. When I do a help on Hab pkg uninstall is not in the list of options. It looks like we are using hab 0.59.0/20180712155441. Maybe I need to look into updating?

Ouch. That is pretty old client. Yes, if you can, I would update to latest stable. I know the core team has been good about backward compatibility.

The one area I would caution is to make sure to test out hab-sup with your services and see what impacts you may have.

1 Like

I’d add you don’t need to keep the cache on disk if you’re building every day. You can run rm -rf /hab/cache/artifacts and i’d bet that will make a whole bunch of clean space.