At first to install gcc4.7 on the Mac, search half circle found macports most convenient. Then, according to the official introduction of the sleeve to open the dry.
See also: https://guide.macports.org/chunked/installing.html
1. First uninstall the old version of Macport
sudo port-fp uninstall installed
and other
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
2. Then start the installation, I chose the SVN installation
mkdir -p/opt//opt/mports$ svn checkout https://svn.macports.org/repository /macports/trunk/opt/mports/trunk/base$. /configure--enable-makesudomakeinstall make Distclean
3. Udpate, this step encountered some difficulties, took a lot of time to solve
Since the direct update always fails, change the update to local, that is, modify the/opt/local/etc/macports/sources.conf, and put the last rsync line off and change it to a local path
#rsync://Rsync.macports.org/release/tarballs/ports.tar [default]file: /// opt/mports/trunk/dports [Default]
When you finish executing the update command:
sudo port selfupdate
There are the following errors:
--->Updating The Ports treesynchronizing local ports tree fromfile:///Opt/mports/trunk/dportsUpdating'.': svn:E175002:Unable to connect to a repository at URL'Https://svn.macports.org/repository/macports/trunk'Svn:E175002:OPTIONS of'Https://svn.macports.org/repository/macports/trunk': Server Certificate Verification Failed:issuer is not trusted (https://svn.macports.org)Command failed:/USR/BIN/SVN update--non-interactive/opt/mports/trunk/dportsexit Code:1Syncing Local Subversion ports tree failederror:couldn'T sync the ports Tree:synchronization of 1 source failedError:follow http://guide.macports.org/#project. Tickets to report a bug.Error:/opt/local/bin/port:port selfupdate failed:couldn'T sync the ports Tree:synchronization of 1 source failed
Using the port-d selfupdate debug trace, found to be the problem of SVN permissions. When update, invoke command "/USR/BIN/SVN update --non-interactive /opt/mports/trunk/dports" Yellow flag Indicates that there is no timely interaction with the system when performing the update, so there is no chance to save the certificate.
Stackoverflows Some foreigners have also discussed this problem, see
http://stackoverflow.com/questions/3147660/server-certificate-verification-failed-issuer-is-not-trusted
finally resolved :
First , tell subversion-to-use your proxies to connect to the Server:if $prefix/var/macports/home/.subversion/servers doesn't exist, create it by copying the corresponding file from another user. (SVN automatically creates this file if it doesn't exist.) Edit thefileand set a proxy forHosts at *.macports.org. Different proxy configurations require Different sets of options here, but thefileis pretty the well commented, so it should being easy-to-figure out what you need. At a minimum'll need settings for Http-proxy-host and Http-proxy-port.Finally,ifYou want-to-use SVN-over-HTTPS-to-access the repository, you'll need to tell SVN to trust the MacPorts signature. (SVN doesn'T trust the authority that issued it, and portSyncBelow invokes svn up with the--non-interactive flag, so you won'T has the opportunity to accept the certificate then.)mkdir-P $prefix/var/macports/home/.subversion/auth/svn.ssl.serverAs A normal user, run SVNlsHttps//svn.macports.org/repository/macports/trunk/dports/. When prompted, accept the certificate permanently.SVN would store the certificateinchAfile inchThe directory $HOME/.subversion/auth/svn.ssl.server. In that directory,FindThefilethat contains thestring "https://svn.macports.org"and copy it into $prefix/var/macports/home/.subversion/auth/svn.ssl.server.
A summary is to $HOME/.subversion/auth/svn.ssl.server. Copy of the file containing the field "https://svn.macports.org" in the directory to
/opt/local/var/macports/home/.subversion/auth/svn.ssl.server/
Then execute port selfupdate
Success, over
MacPorts Installation Notes