How do I remove MacPorts on an “unsupported OS” i.e. El Capitan Public beta?

别说谁变了你拦得住时间么 提交于 2019-12-18 11:50:56

问题


The MacPorts installation that I had on Yosemite doesn't work on the El Capitan since it isn't supported yet. I want to remove the Port installation here but I'm not able to run any of the Port commands. Does anyone have an idea how to clean it up?

On running any port command, I get the following error:

Error: Current platform "darwin 15" does not match expected platform "darwin 14"
Error: If you upgraded your OS, please follow the migration instructions: https://trac.macports.org/wiki/Migration
OS platform mismatch
    while executing
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, OS platform mismatch

回答1:


This solution worked for me, without remove it:

  • xcode-select --install
  • xcodebuild -license
  • wget https://distfiles.macports.org/MacPorts/MacPorts-2.3.3.tar.bz2
  • tar xzvf MacPorts-2.3.3.tar.bz2
  • cd MacPorts-2.3.3
  • ./configure && make && sudo make install
  • cd ../
  • rm -rf MacPorts-2.3.3*

Source




回答2:


I just went ahead and manually removed the files (using rm):

sudo rm -rf /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

It didn't seem to leave any leftovers or break anything.

One thing to note however is that mactex seems to have been installed in the same directory so that got removed as well. I didn't realize that I had that in the same directory. If you're going to repeat the same steps, keep this in mind.




回答3:


What I did successfully on my El Capitan:

  1. xcode-select --install
  2. xcodebuild -license
  3. Reinstall MacPorts by using the correct *.pkg matching your OSX from https://www.macports.org/install.php
  4. done.



回答4:


wget is fetching a bz2 file but unzip instructions are for gz. Try the following instead

tar xjvf MacPorts-2.3.3.tar.bz2

The rest worked fine on El Capitan.

Thanks.



来源:https://stackoverflow.com/questions/31483432/how-do-i-remove-macports-on-an-unsupported-os-i-e-el-capitan-public-beta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!