Menu Home

Macports update错误

执行port -v selfupdate的时候出现如下的错误:

checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions
Command failed: cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc OBJC=/usr/bin/cc ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 1
Error: Error installing new MacPorts base: command execution failed

解决方法:

  1. 安装”Command Line Tools”:
    $ sudo xcode-select --install
    
  2. 更新macport或者某个包
    $ sudo port selfupdate