Can't update Macports (with Mac OS X Mavericks)

你说的曾经没有我的故事 提交于 2019-11-29 18:45:27
imxylz

Install the "Command Line Tools" first:

sudo xcode-select --install

(Explicitly agreeing to the license is sometimes necessary via "sudo xcodebuild -license")

Then upgrade the ports:

sudo port -v selfupdate
Brett Hale

I answered a similar question. The location of the Tcl framework has changed, breaking the existing MacPorts infrastructure. The 2.2.1 installer for Mavericks has since become available here. Make a list of your installed ports, and consider deleting /opt/local prior to installing. You will likely need to 'update' everything anyway.

There might be a chance that you haven't agreed with the XCode license. If xcode-install doesn't help, you can run the belowing command to agree with Xcode license. sudo xcodebuild -license

there is an actual bug with

gperf @3.0.4: error: expected parameter declarator

thankfully this issue has its own ticket at MacPorts ticket 40918

if anything you could read all the issues in Mavericks at http://trac.macports.org/wiki/MavericksProblems

I had the same issue. I am assuming that you had Xcode command line utils installed previously. Just launch XCODE and let it finish configuration. Now rerun port command and it should work properly.

I got an error with selfupdate, and resolved it by doing a fresh installation of MacPorts from http://www.macports.org/install.php. Now I can run the selfupdate command without error and install other ports.

The error I were seeing was below, it seems the same problem as Yo Sophia has pointed out:

$ sudo port selfupdate
Password:
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.1.3 installed,
MacPorts base version 2.2.1 downloaded.
--->  Updating the ports tree
--->  MacPorts base is outdated, installing new version 2.2.1
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed

I mainly wanted to comment on @Brett's answer above (sorry, SO n00b still, not allowed) and share my experience upgrading... not really a new answer, but hopefully some useful info.

I downloaded and installed the Mavericks MacPorts installer as described above, (but without removing /opt, as suggested by @King Julian did self update which was fine, and then upgrade outdated and it seems to be uninstalling and reinstalling all my ports with a message:

Warning: Deactivate forced.  Proceeding despite dependencies.

on each one. Luckily i made a copy of the etc and apache2/conf dirs, so should be able to get my config back when it eventually finishes... after 30 minutes or so it threw an error

Unable to open port: extra characters after close-quote

So i did self update again and upgrade outdated seems to run again...

So looks like it can be done (LAMP all working anyway) - it might have been quicker to start again from scratch, but make sure you have at least a couple of hours spare for this (and be connected to mains power ;)

Apologies if too much info, but hope it helps!

The problem seems to be with Macports and the location of the Tcl framework and it's path once Xcode has been installed. I suggest installing a fresh version of Macports for Mavericks here : http://www.macports.org/install.php.

I had this issue on Mountain Lion and it was actually to do with MacPorts looking at an old XCode path (I had several versions including betas installed). I ran with the -d option and checked the config.log file at /opt/local/var/macports/sources/rsync.macports.org/release/base and it reported some errors:-

--- snip ---
...
configure:3331: checking for C compiler version
configure:3340: gcc --version >&5
Configured with: --prefix=/Applications/Xcode5-DP3.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
xcrun: Error: could not stat active Xcode path '/Applications/Xcode5-DP3.app/Contents/Developer'. (No such file or directory)
configure:3351: $? = 0
configure:3340: gcc -v >&5
Configured with: --prefix=/Applications/Xcode5-DP3.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
xcrun: Error: could not stat active Xcode path '/Applications/Xcode5-DP3.app/Contents/Developer'. (No such file or directory)
...
--- snip ---

So I gave it the correct path using:-

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

and that fixed it.

I got my clues from this useful page.

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