A quick guide to urpmi --parallel

The Mandriva package manager, urpmi, is woefully underappreciated, I always feel. So here's a quick guide to one of its cooler features...

urpmi parallel mode does what it sounds like; you run an urpmi command and it happens on many machines in parallel. In more detail - the machine you run the command on tests its result on each machine in the group in turn, downloads all necessary packages for all machines in the group, distributes the appropriate packages to each machine, then calls urpmi on the machine to do the actual installation. It's brilliant for quickly installing software on all your machines, or even keeping them all up to date with a couple of commands, and it saves on bandwidth, as each necessary package is downloaded only once. The only drawback at the moment is that you cannot include the server machine in the group, which makes it a little less good for small home networks.

So how to use it? It's pretty simple, really. First, make sure you can ssh from the server to each client machine as root (it's OK if you have to enter a passphrase or password, but cooler and less hassle if you set up keys and use ssh-add so you don't have to). Now install urpmi-parallel-ssh on the server machine. Edit /etc/urpmi/parallel.cfg to look something like this:

local:ssh:toy:htpc

the first parameter is the name of the group, make this whatever you like. Leave the second as ssh. The remaining parameters are the hostnames of the machines in the group; as many as you like (but not the server machine. You can try it, but urpmi will just fall over its own lock files).

Next step? There is no next step! Now you can use it. On the server machine, run:

urpmi --parallel local somepackage

As long as urpmi on the server has access to all packages required by all client machines from its urpmi media, everything should now work smoothly. (The easiest way to ensure this is to have all machines - server and client - use the same urpmi media).

The other neat trick you can do with this is keep a group of machines up-to-date. On my home network, which includes zen (the server), toy and htpc, I run this series of commands on zen to keep all the machines up to date with Cooker:

fanout "localhost toy htpc" "urpmi.update -a"

(fanout runs a single command on several machines at once; it's useful. Uses ssh.)

urpmi --auto-select --keep --noclean -v

(noclean keeps the packages on zen after they've been installed; this means when I do the parallel command at the next stage, it doesn't go out and download 'em all again.)

urpmi --parallel local --auto-select --keep -v

...and done. Once Rafael fixes urpmi so the server can be in the parallel group, it'll be even simpler.

Comments

bmckee wrote on 2005-08-10 15:42:
Adam - Thanks for the info - mind if I post a copy at http://mandrake.vmlinuz.ca/bin/view/Main/WebHome ?
adamw wrote on 2005-08-10 23:14:
Go ahead.