LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   CentOS 6 - 'alternatives' command (https://www.linuxquestions.org/questions/linux-server-73/centos-6-alternatives-command-4175511979/)

mcresist 07-22-2014 09:04 PM

CentOS 6 - 'alternatives' command
 
Hello LQ,

I recently ran into the 'alternatives' command ( /usr/sbin/alternatives ). It helped me through a migration from Oracle Java ( :( ) to openjdk ( :) ).

I've read through the man page, and have an understanding of what the program is designed to do. However, I can't decide if this command is actually something I should lean on regularly. Sure, it helped me through a sticky situation with Oracle V. OpenJDK, but I'm curious if this command is "recommended".

Anybody have any thoughts on that command?

vikas027 07-22-2014 11:35 PM

Quote:

Originally Posted by mcresist (Post 5208145)
Hello LQ,

I recently ran into the 'alternatives' command ( /usr/sbin/alternatives ). It helped me through a migration from Oracle Java ( :( ) to openjdk ( :) ).

I've read through the man page, and have an understanding of what the program is designed to do. However, I can't decide if this command is actually something I should lean on regularly. Sure, it helped me through a sticky situation with Oracle V. OpenJDK, but I'm curious if this command is "recommended".

Anybody have any thoughts on that command?

I have not used this command but normally something which has helped you out and comes with a default distro can be trusted and be used as any other command.

John VV 07-23-2014 01:01 AM

years ago in the PRE "alternatives" days there was a problem
A really BIG PROBLEM .

one that was normally fixed by using scripts to set the "DEFAULT" version of a program if more that one version is installed
like
gcc 3.3
gcc 4.1
gcc 4.3
gcc 4.9

Oracle java
OpenJDK

libpng 14
libpng 12

Python 2.7
Python 3.3

so alternatives got created TO FIX that issue


now some of us still use bash scripts to reset these
but alternatives is there to do that

grim76 07-23-2014 07:19 AM

Alternatives is a great tool. I use it to make upgrades to Java on our production systems. The Dev folks point to the same location every time regardless of the java version or the directory structure.

mcresist 07-23-2014 10:01 AM

Thanks for all the input.


All times are GMT -5. The time now is 05:18 PM.