# Is it safe to delete MacPorts distfiles?

- URL: https://moreroom.app/folders/macports-distfiles
- Item: MacPorts downloaded sources
- Location: `/opt/local/var/macports/distfiles`
- Verdict: Safe to remove — Rebuilt or re-downloaded automatically when needed.
- Comes back on its own: yes
- Official command: `sudo port reclaim`
- Source: MoreRoom rules catalogue (2026-10-17), by Yando Pte. Ltd.

## What is it?

MacPorts keeps the source archives and other files it downloads to build ports in `/opt/local/var/macports/distfiles`. They are needed only to rebuild a port, and files for old versions stay after upgrades. The folder is owned by the system, so changes need an administrator password.

## What happens if you delete it?

MacPorts downloads distfiles again only when it needs to build or rebuild a port. Installed ports keep working.

## How to remove it properly

Run `sudo port reclaim` in Terminal (administrator password required). It lists inactive ports, unrequested ports nothing depends on and distfiles that are no longer needed, and asks before removing them; removals are permanent. `sudo port -y reclaim` does a dry run first.

## Before you delete it

Run `port installed unrequested` beforehand and mark ports you want to keep with `sudo port setrequested <name>`, otherwise reclaim may offer to uninstall them.
