Which command should I run to
- delete all old port versions
- delete downloaded files
- temp files created during build
- all other stuff which I don't need when I am sure that updated version works fine
I got a suggestion to use
port clean --all allbut it tries to clean ports I don't have, though I tried
port clean --all installedbut it did not delete old inactive versions, then
port -u uninstallbut it got stuck saying that py25-nose (which is active) depends on py25-setuptools (which is inactive).
3 Answers
The suggestions you received cover what you're after:
sudo port -f clean --all all
sudo port -f uninstall inactiveIf you can't wait for the clean one to run in the background, there are a few commands you can run manually and faster.
Remove leftover build files (this is done automatically by default):
sudo rm -rf /opt/local/var/macports/build/*Remove download files:
sudo rm -rf /opt/local/var/macports/distfiles/*Remove archives (these aren't created by default):
sudo rm -rf /opt/local/var/macports/packages/* 7 port uninstall inactiveis the way to go.
4I just wanted to add my experiences with the above in case it helps anyone else: When I ran
port clean --all all
it ran for several minutes, and this made me concerned, so I interrupted the process.
I too, wanted to "clean up" after multiple installs of Macports on Yosemite. I had installed first via Terminal, and then did
rm -rf MacPorts-2.3.3 which I realized does not clean up, because I saw the command port stopped working.
My solution: I installed again with the pkg installer, which doesn't leave any directories behind.
2