Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Edit: Solved, see resolution below


Is it possible to add a custom link group to update-alternatives that is not already there by default?

For example, I want to add Scala and all its supporting binaries as a link group 'scala'. I'm trying using this script, but keep getting the error:

update-alternatives: error: unknown argument `'

I'm not sure what that means, but after troubleshooting the script a bit with no luck, I'm wondering if update-alternatives has a hard-coded list of link groups, that can't be added to, and that doesn't include scala.

share|improve this question
    
You should add your solution as answer. –  Jakob May 30 '12 at 17:18
    
Add your solution as an answer, instead as part of the question (otherwise it shows up as unanswered, and that's bad) –  Thomas W. May 30 '12 at 17:46
    
Done, thanks. I can't accept it as the answer for 2 days, so will do that then. Thanks also for the new tag. –  Kurtosis May 30 '12 at 23:17

2 Answers 2

you can use:

update-alterntives --install <path-to-generic-binary> <generic-binary-name> <path-to-alternatives> <priority>

so that for installing scala of different versions, you could do like:

update-alterntives --install /usr/bin/scala scala /opt/scala-x.x.x/bin/scala 1200

Note:

this is an extracted version of the accepted answer, from the accepted answer's script link.

Added here so that the answer be here even if the link breaks in the future.

share|improve this answer
up vote 1 down vote accepted

Solved: Yes you can add custom link groups, they're not limited to anything hard-coded by Ubuntu.

My particular problem was a finicky error in the script - I had left spaces after the line continuation backslashes \ at the end of each line in the script, that broke it. Fixed that, it works now.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.