日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【转载】[OS X笔记]安装MacPorts

發布時間:2025/3/21 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【转载】[OS X笔记]安装MacPorts 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

【轉載】http://weimenlove.blog.163.com/blog/static/1777547320124282192310/

1. 安裝必要的軟件

安裝MacPorts需要先安裝X11和Xcode,Lion系統已經默認安裝好了X11,在Appstore里安裝Xcode即可。

下載完Xcode之后,一般路徑在/Application下,可以先將其拷出來,以備后續使用:

$ cp -a /Application/Xcode.app ~/soft

?

2. 安裝MacPort,并安裝

下載地址:https://distfiles.macports.org/MacPorts/,可以直接下載Lion下的最新版:https://distfiles.macports.org/MacPorts/MacPorts-2.1.1-10.7-Lion.pkg

如果MacPort出現新版本,可以直接通過如下命令進行更新:

$?sudo port -v selfupdate

添加MacPort到環境變量,vi ~/.bash_profile

export PATH=${PATH}:/opt/local/bin:/opt/local/sbin:/opt/local/share/man

?

3. 比如安裝bash的自動補全軟件:

$ sudo port install bash-completion

Error: No valid Xcode installation is properly selected.

Error: Please use xcode-select to select an Xcode installation:

Error: ? ? sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer # version 4.3.2

Error: ? ? sudo xcode-select -switch /Users/zhaobinjie/soft/Xcode.app/Contents/Developer # version 4.3.2

錯誤解決方法,1)設置xcode-select的路徑,2)安裝命令行工具:

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

You can get Xcode from the Mac App Store as a free download. From within that (in the preferences | downloads) you can download and install the command line tools.

?

4.?MacPort常用操作

查詢安裝的ports

$ port -qv install

當安裝新的系統時,卸載安裝的ports

$?sudo port -fp uninstall --follow-dependents installed

清除所有局部的構建

$?sudo port clean all

安裝必須的ports

$?sudo port install portname +variant1 +variant2 …

?

5.?刪除MacPorts:

#原版使用MacPorts安裝過的軟件在/opt/local目錄下,刪除之前最好查看下,心里有個數.

$ sudo port -f uninstall installed
$ 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

?

Reference:

http://stackoverflow.com/questions/9904326/warning-the-command-line-tools-for-xcode-dont-appear-to-be-installed-most-por

http://www.macports.org/install.php

http://hi.hiing.net/2011/06/use-homebrew-package-management.html

轉載于:https://www.cnblogs.com/oracoo/archive/2012/07/08/2581798.html

總結

以上是生活随笔為你收集整理的【转载】[OS X笔记]安装MacPorts的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。