mac port 更新报错:Error installing new MacPorts base: command execution failed

核心提示:

回想你是不是更新过xcode,而且更新过后,还没有使用过。如果是,请同意一下命令行版的用户协议,终端里运行

sudo xcodebuild -license然后按提示输入 agree,完了重试port更新。

如果不是这样,那请转到google搜索,并啃英文资料吧。

其实只需要看到这里就够了,下面是发现这一点的过程,可以认为是废话,不推荐继续阅读;读了也不多,多花费一点时间而已。

mac port 用了一段时间,需要更新,但是出错了,如下:

sh-3.2# port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.3.3 installed,
MacPorts base version 2.3.4 downloaded.
--->  Updating the ports tree
--->  MacPorts base is outdated, installing new version 2.3.4
Installing new MacPorts release in /opt/local as root:admin; permissions 0755

Error: Error installing new MacPorts base: command execution failed
Please run `port -v selfupdate' for details.
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed那就按提示,带-v参数,看详细信息

sh-3.2# port -v selfupdate
checking Mac OS X version... 10.10.5
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 7.1.1
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/sources/sea.us.rsync.macports.org/release/tarballs/base':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command failed: cd /opt/local/var/macports/sources/sea.us.rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc OBJC=/usr/bin/cc ./configure --prefix=/opt/local --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 77
Error: Error installing new MacPorts base: command execution failed
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed看上面消息里的 Command failed 一行,原始命令竟然是 cc 报错,新打开一个终端页,运行cc,果然是不正常的,如下

fsmac:~ feng$ cc

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

fsmac:~ feng$ cc -v

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

fsmac:~ feng$ cc --version

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.没有仔细看,google了一下前面错误消息,国外社区里有相关帖子http://stackoverflow.com/questions/19622337/cant-update-macports-with-mac-os-x-mavericks ,说

Install the "Command Line Tools" first
sudo xcode-select --install这货之前确实安装过,又往下看,有说

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

回想一下,果然,前几天安应用商店里更新了xcode,这货更新了,但还得再次确认一下同意协议,苹果真够??碌?/p>

fsmac:~ feng$ sudo xcodebuild -license

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'

Apple Inc.

Xcode and Apple SDKs Agreement
......
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]

agree后,再运行,正常的了

fsmac:~ feng$ cc
clang: error: no input files
fsmac:~ feng$ cc --version
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

时间: 2024-09-20 10:44:00

mac port 更新报错:Error installing new MacPorts base: command execution failed的相关文章

Windows 8 Windows update 更新报错80244fff的解决思路

  故障现象: Windows 8 Windows update 更新报错80244fff. 原因分析: 没有设置更新Windows体验指数. 解决方案: 第一步:更新Windows体验指数 1. 右击"计算机"选项,选择"属性"; 2. 点击或单击"Windows体验指数", 等打分完毕后,就可以更新了. 第二步:变更DNS 1. 打开控制面板---网络连接---右键当前的网络连接;(本地连接或宽带连接) 2. 选择"属性"

lnk1120-vs2010运行程序报错:error LNK2019: 无法解析的外部符号

问题描述 vs2010运行程序报错:error LNK2019: 无法解析的外部符号 如题,我在vs2010环境下做C++练习题时出现该错误.程序代码如下: //array.h#ifndef ARRAY_H#define ARRAY_Htemplate<typename T>class Array{public: Array(int n);//数组首地址不用指定,待会分配 Array(Array &a); ~Array(); T getAt(int i);//返回第i个数组元素 voi

php图片上传报错error=3

问题描述 php图片上传报错error=3 upload: <?php/** Created by PhpStorm. User: rosen Date: 15-11-5 Time: 下午8:43*/print_r($_FILES['file']); ?> 为什么程序运行结果报错Array ( [name] => 2015-10-19 18:47:42屏幕截图.png [type] => [tmp_name] => [error] => 3 [size] => 0

sfs2x-求救!mac 装smartfoxserver报错,高手请指导!!

问题描述 求救!mac 装smartfoxserver报错,高手请指导!!

linux使用wkhtmltopdf报错error while loading shared libraries:

官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在linux上执行 ./wkhtmltopdf –page-size A4 www.baidu.com pdf.pdf 报错   error while loading shared libraries: libXrender.so.1 root@mag-sit:/home/mag-sit/wkhtmlt

mvel no context-MVEL 使用模板,当并发量大的时候, 报错 [Error: no context]

问题描述 MVEL 使用模板,当并发量大的时候, 报错 [Error: no context] Caused by: java.lang.RuntimeException: no context at org.mvel2.ParserContext.makeVisible(ParserContext.java:684) at org.mvel2.ParserContext.addVariable(ParserContext.java:477) at org.mvel2.ast.TypedVarN

arcgis-ArcSDE 做POST报错Error: Operation Failed (-1).

问题描述 ArcSDE 做POST报错Error: Operation Failed (-1). 同一主机:Windows2008 R2 64位,ArcSDE for 11g 64bit 本机Oracle11g64位服务端,Oracle11g 32位客户端,Oracle10g 32为服务端 环境变量 path C:appAdministratorproduct11.2.0client_1bin;E:appAdministratorproduct11.2.0dbhome_1bin;C:Progra

docker rmi报错Error response from daemon

docker commit了一个镜像之后想删除旧的镜像,出现以下报错 Error response from daemon: conflict: unable to delete 6f8214d56bfc (cannot be forced) - image has dependent child images 解决思路: docker save保存容器 docker images docker save REPOSITORY > XX.tar 删除镜像容器 docker ps -a docke

spring分布式事物-atomikos mssql报错Error in recovery以及找不到存储过程

问题描述 atomikos mssql报错Error in recovery以及找不到存储过程 如题,我使用atomikos做spring分布式事物,同时支持Oracle.MySQL和MSSQL三种数据源.目前Oracle和MySQL都能调通,在测试MSSQL的过程中,一直报错. 错误如下: 2015-06-03 14:08:45,911 WARN com.atomikos.datasource.xa.XATransactionalResource.logWarning:24 - Error i