Minimising MacPorts Internal Disk Usage

Lawrence Velázquez larryv at macports.org
Wed Aug 14 23:22:22 PDT 2013


On Aug 14, 2013, at 10:21 PM, Bob M <urilabob at gmail.com> wrote:

> I have an MB air with internal (smallish) SSD. I need some of the programs provided by MacPorts at all times, but I'm happy to do all builds while connected to a large-ish external HD. I just hit a crisis when the /opt directories hit 27GB. So what I want to do is to put as much as possible of the build environment onto the HD, and substitute symbolic links on the SSD.

This will not work under MacPorts 2.2.0, and it's not clear that this will be fixed.

https://trac.macports.org/ticket/39850

What you could do instead is move the contents of /opt/local/var/macports to a directory on your external drive and set "portdbpath" in macports.conf to that new path.

> I'm assuming this is OK so long as nothing hard-links into these directories.

As Ryan noted, MacPorts base probably expects portdbpath to exist, so you may run into odd errors. But you ought to be fine if you only use port(1) when your external is mounted.

> So far, I've saved about 12GB on the SSD, but that still leaves around 15GB (some of which may be Xcode-related rather than MacPorts, I'm not sure where Xcode puts stuff).

Xcode doesn't install anything under /opt.

> I'd like to go further if it's possible.

The lib, libexec, share, and var directories use up 96% of my own MacPorts installation. Again, as Ryan noted, you can't really move anything other than ${prefix}/var/macports.

vq


More information about the macports-users mailing list