We have a proxy in work that prevents connections from being made out directly. I found out about the awesome MacPorts program, which is a bit like apt for OSX. It pulls backports from a repository and installs them for you.
There’s not a lot to the tool’s installation if you live on the open web, but I needed to do some stuff to get it working with our squid proxy.
If you run
sudo port selfupdate, and get an error that says ‘port selfupdate failed: Couldn’t sync the ports tree’ or something like that, chances are your proxy is blocking rsync.
There are three steps. The prerequisites required for this to work are that you have the proxy address, admin access to your mac, and that the proxy supports the rsync port (873/tcp).
You can test the connectivity by going to http://rsync.macports.org:873, you should get the following error:
@ERROR: protocol startup error
If that works ok, then you need to set up the sudo environment for osx to let proxy environment settings through. First, edit your sudoers file with:
Do not just edit /etc/sudoers
You need to append these lines:
Defaults env_keep += "http_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY"
Defaults env_keep += "ALL_PROXY NO_PROXY"
Now, you need to set your http proxy
where 8080 is the port number of the proxy
By Default, port uses rsync to manage its updates. RSync can use a proxy environment setting (man rsync for mre)
Note the rsync proxy capitalisation, and the fact that it does not need http://
That should do it. You can then run selfupdate to get port to the latest version.
The hard way
If that doesn’t work, you can have a look at these instructions for replace rsync with subversion:
Syncing with SVN in Macports