Christopher Jones jonesc at
Mon Aug 20 17:42:09 UTC 2018

> On 20 Aug 2018, at 6:32 pm, William Parducci <bill at> wrote:
>> On Aug 20, 2018, at 10:17 AM, Christopher Jones <jonesc at <mailto:jonesc at>> wrote:
>>> On 20 Aug 2018, at 4:03 pm, Lee Bast <x-lists at <mailto:x-lists at>> wrote:
>>>> On Aug 20, 2018, at 1045 , William Parducci <bill at> wrote:
>>>> For future reference NEVER issue sudo rm -rf in a multiline command. It is just asking for stuff like this to happen.
>>> 	The guide (and a lot of MacPorts in general I guess) is more aimed at devs and power users so it kind of assumes everyone is comfortable with the CLI and knows basic footguns, but looking at that page it might be a reasonable idea to not just tell people to run a copy-pasted multiline sudo rm -rf command. It's a dangerous enough thing and it's a low bar to not say "copy and run this" and change it to "here are a list of MacPorts' file and directory locations, delete them for a full manual removal", then leave it to users.
>> Whilst I have myself pointed people at that page myself in the past, perhaps a case could be made that having a public web page with instructions that start with “sudo rm -rf “ is perhaps not the best idea. If the user copies the command badly, and doesn’t appreciate how powerful it can be, they could (and it seems have) run into problems.
>> Perhaps we should not have that command explicitly written there. Better yet perhaps and official ‘uninstaller’ that does the equivalent in a control manner would be better.
> Another option for consideration is to put in a disclaimer along the lines of “DO NOT ATTEMPT UNLESS YOU UNDERSTAND WHAT THIS DOES AND THE RISKS INVOLVED.” on pages that have OS command line executables

That is a easy thing to do, but only helps if people read it and understand. Also, if the user is not familiar with doing things at the command line does not help prevent cut ’n’ paster errors.

>  and/or recompose the commands to individual lines so as to—in theory—make them less prone to misapplication:
> $ sudo rm -rf /opt/local
> $ sudo rm -rf /Applications/DarwinPorts 
> $ sudo rm -rf /Applications/MacPorts 
> $ sudo rm -rf /Library/LaunchDaemons/org.macports.* 
> $ sudo rm -rf /Library/Receipts/DarwinPorts*.pkg 
> $ sudo rm -rf /Library/Receipts/MacPorts*.pkg 
> $ sudo rm -rf /Library/StartupItems/DarwinPortsStartup 
> $ sudo rm -rf /Library/Tcl/darwinports1.0 
> $ sudo rm -rf /Library/Tcl/macports1.0 
> $ sudo rm -rf ~/.macports

I am not sure that helps. You have replace one cut and paste instance, with multiple ones all of which could go wrong.

My best guess as to what happened here is the OP some how got some spaces into the above, so effectively ran ‘sudo rm -rf *’ on their home area.

Honestly, I suspect the only safe fix here is to provide an uninstaller (could just be a bash script) that does it safely for the user…


> b

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1910 bytes
Desc: not available
URL: <>

More information about the macports-users mailing list