I have 2 commands that I switch between using update-alternatives on Debian. My problem is that each command also has an autocompleter command that has to be switched at the same time the command is switched. Is there some way I can keep the 2 commands managed in a single "alternative", so that when I switch commands (using update-alternatives --set ...) the autocompleter is switched as well?

1 Answer 1


Make the autocompleter a slave link. See the manual for details (look for "changed as a group").

In your package's postinst script:

update-alternatives --install /usr/bin/someprogram someprogram /usr/bin/foo-someprogram $PRIORITY \
    --slave /usr/share/zsh/site-functions/_someprogram /usr/share/zsh/site-functions/_foo-someprogram

where $PRIORITY is the numeric priority of the alternative when automatic selection takes place.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .