How do I change the Software Update server address on a client Mac (to use my own server)?

Now that I have started the Software Update service on my Leopard Server, how do I change my client Macs to check for updates on it?


Solution 1:

Defaults

The simplest method is to run a defaults command on the client Macs (easily pushed via Apple Remote Desktop):

defaults write com.apple.SoftwareUpdate CatalogURL 'HTTP_URL_FOR_CATALOG'

for a user. If you run it via sudo it will set it for whenever you use softwareupdate as root.

The HTTP_URL_FOR_CATALOG has been changed with Mac OS X 10.6. If you use MCX it will automatically pick the new catalog - however if doing it manually the following URLs need to be used for whichever client version is in question:

  • Mac OS X 10.4: http://mysus.example.com:8088/index.sucatalog
  • Mac OS X 10.5: http://mysus.example.com:8088/index-leopard.merged-1.sucatalog.sucatalog
  • Mac OS X 10.6: http://mysus.example.com:8088/index-leopard-snowleopard.merged-1.sucatalog
  • Mac OS X 10.7: http://mysus.example.com:8088/index-lion-snowleopard-leopard.merged-1.sucatalog
  • Mac OS X 10.8: index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog

To double check this applied you can run the following command:

/usr/libexec/PlistBuddy -c Print /Library/Preferences/com.apple.SoftwareUpdate.plist
and /usr/libexec/PlistBuddy -c Print ~/Library/Preferences/com.apple.SoftwareUpdate.plist
to see what settings are for the computer and user appropriately.

If this is working correctly when running Software Update (GUI) you should see the server address appear in parenthesis in the title of the window.

MCX

Another alternative is to use Workgroup Manager to manage the preferences via MCX from your server. This can be done for users, or for computers if they are bound to your Open Directory.

If you are using 10.5 Server or newer: you can simply use the Software Update section under Preferences.

Manually:

  1. Choose the accounts, computers, or groups to have the preference applied to.
  2. Click on Preferences, and then the Details tab
  3. Press the Add... button and navigate to /Library/Preferences/com.apple.SoftwareUpdate.plist
  4. Press Edit...
  5. Under Often, add a New Key and enter the name CatalogURL
  6. Make sure the type is string and then enter your SUS URL (eg. http://mysus.example.com:8088/index.sucatalog or if using 10.6: http://mysus.examle.com:8088/ - see above from the defaults section)
  7. Press Apply Now, then Done. Once users/computers have refreshed their MCX settings (usually the next login or restart) the new settings will take over.

If this is working correctly when running Software Update (GUI) you should see the server address appear in parenthesis in the title of the window.

Solution 2:

In order to have a system-wide configuration one has to run the following:

sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL "http://your.updates-server.lan:8088/index.sucatalog"

In order to correctly work both on Leopard and Snow Leopard the right command to issue is:

defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL "http://your.updates-server.lan:8088/index-leopard-snowleopard.merged-1.sucatalog"

Happily used and tested on my network :)

Solution 3:

The DNS trick that Chealion points out is fantastic. I use it at our office, and every computer on our LAN will automatically pull the updates from the local repository at high speed without any configuration.

Create the swscan.apple.com DNS zone on your internal DNS server, and have it resolve via an A record to your Mac OS X Server. On the Mac OS X Server itself, edit the /etc/hosts file and add the actual IP address for swscan.apple.com so that it doesn't resolve back to itself.

One thing to point out - you will need a Snow Leopard server for it to work with Snow Leopard clients - otherwise it breaks.

Note - 10.5 SU Repository is in /usr/share/swupd, 10.6 SU Repository is moved to /private/var/db/swupd.

You also need to enable the Web Service and add the following Web Aliases on port 80 in Server Admin, for 10.4, 10.5, and 10.6 clients to get the updates:

Pattern: index.sucatalog
Path: /private/var/db/swupd/html/content/catalogs/index.sucatalog

Pattern: /content/catalogs/others/index-leopard.merged-1.sucatalog
Path: /private/var/db/swupd/html/content/catalogs/others/index-leopard.merged-1.sucatalog

Pattern: /content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog
Path: /private/var/db/swupd/html/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog

Pattern: /content/catalogs/index-1.sucatalog
Path: /private/var/db/swupd/html/content/catalogs/index.sucatalog