The details can be found here, but for the impatient, the steps are essentially: sudo mkdir -p /opt/local/var/macports/sources//trunk/dports/Ĭd /opt/local/var/macports/sources//trunk/dports/ Update: there’s yet another piece to this for those behind a firewall or proxy that blocks rsync protocol connections (on port 873): you’ll need to sync the MacPorts tree via Subversion, and then change your ports source to use the SVN tree. I keep forgetting about this fix, and it has cost me hours of manual package downloading while away from the proxied network, as I’d forgot about fixing the proxy settings … I hope it saves someone else some trouble! Just the http and skip settings may be enough for most, depending on how you get your source packages. Sudo vim /opt/local/etc/macports/nfĪt the very bottom of the file, you’ll want to edit the following directives to reflect your proxy settings: proxy_http In the not-so-distant past, it was rather complicated to get this working, using rsync etc. Log for some-package is at: /opt/local/var/macports/logs/_some-package/main.log > Attempting to fetch 2 from Įrror: Target returned: fetch failed If you’re trying to use MacPorts, and you’re behind a proxy or firewall, chances are you’ll see errors like the following when you try to install or upgrade a port: -> Fetching some-package You should see a long list of ports being downloaded.How to get MacPorts working if you’re behind a proxy/firewall. We do this so you can see what is happening behind the scenes. Note that the -d switch invokes the command in debug mode. Test this by typing the following command. You should now be able to load the latest ports using the http proxy. Test your new proxy environment variables are now available: This is required to forward your proxies to the superuser account every time you run sudo port commands.Īppend the following to the end of the list of Defaults:ĭefaults env_keep += "http_proxy rsync_proxy HTTP_PROXY RSYNC_PROXY"Įxit the terminal shell and start a new session to load the new settings. # CORP PROXY HTTP and HTTPSĮxport http_proxy= export HTTP_PROXY= export https_proxy= export HTTPS_PROXY= # RSYNC #rsync:///release/ports/ Įdit your profile script, this could be in the form ~/.profile, ~/.bash_profile, etc.Īdd the following to the bottom of the file: When you are done, it should look something like this: Sudo vim /opt/local/etc/macports/nfĬomment out the line at the bottom of the file and add a new one that uses the HTTP address. Enter the superuser password when prompted. Open a terminal window and edit the MacPorts source configuration file. We will change it so it uses HTTP instead. MacPorts is configured to synchronize its list of ports via rsync.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |