laspiritual.blogg.se

Update alternatives java
Update alternatives java













The second line in each of these files defines the master link you're looking for. You'll find this information in /var/lib/dpkg/alternatives (by default). Of course the alternatives system has to store the config for each group and it turns out that it's called administrative directory and written on the man page -) I've been curious how update-alternatives knows what's the command symlink and took a short look into the sources. Even if I don't like to use graphical stuff for such basic jobs it is quite convenient and I ended up using this tool instead of the command line tools. Instead you might want to have a look at galternatives, a front-end to the alternatives system. But since this is quite messy in my opinion I won't recommend it.

update alternatives java

Which you could then use as input for the -install call. What you could do is writing some hack to parse the output of the -query call, maybe like this: update-alternatives -query java | /bin/grep Link | cut -f 2 -d " "

update alternatives java

I've been searching for a solution for this some time ago, but it seems that there is no simple workaround, yet. Unfortunately, I don't have an answer to your second question. So, you see my chain goes like /usr/bin/java -> /etc/alternatives/java ->. in my case for java: % update-alternatives -query java To answer your first question I'd like to hint you to -query: -query nameĭisplay information about the link group like -display does, but in a machine parseable way (see section QUERY FORMAT below).Īrmed with this you will get the link source, e.g. So, here comes the questions: (1) Are there any update-alternative arguments that can output the current link that is pointing to a specific alternative, or (2) is there a way to install a new alternative without having to provide a new parameter, simply keeping the current ? That works fine, but as you see, running the command with /tmp/randomStuff as the parameter is very awkward.

update alternatives java

Reading the output I find out the old link that was pointing to the alternative, so I can finally run my command again with the right parameter, changing /tmp/randomStuff to /usr/local/bin/java: sudo update-alternatives -install /usr/local/bin/java java /usr/local/java/jre1.7.0_25/bin/java 0 That command will output: update-alternatives: renaming java link from /usr/local/bin/java to /tmp/randomStuff. What I currently do is: sudo update-alternatives -install /tmp/randomStuff java /usr/local/java/jre1.7.0_25/bin/java 0 Let's say I want to add a new version of Java Runtime Edition, but I don't know the current symlink that links to the alternative ( parameter). I've looked up the manual of update-alternatives several times but I can't find out how to show the current link pointing to a specific alternative, and that information is needed when adding a new alternative.įrom the update-alternatives manual: -install















Update alternatives java