LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 11-19-2005, 12:23 PM   #1
timb5163
LQ Newbie
 
Registered: Aug 2005
Location: Iowa
Posts: 14

Rep: Reputation: 0
alternatives command not working


I am installing Java and following these instructions. When I use the alternatives command I get this response.

[timb@Home timb]$ su -
[root@Home root]# alternatives --install /usr/bin/java java /usr/java/jre1.5.0_05/bin/ java 3
-bash: alternatives: command not found

Any suggestions. Thanks.


Timb
 
Old 11-19-2005, 01:12 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
-bash: alternatives: command not found
This is saying your shell (bash) couldn't find a location for a command named "alternatives".

Possible reasons for this:

1) The path where the command exists is not in your PATH variable.

2) The command is not on your system.

3) The command is on your system but doesn't have execute bit set so isn't recongized as an executable.

To find where the command is:

find / -name alternatives

The above should print out the full directory for this command (e.g. /usr/local/bin/alternatives).
You would then type "echo $PATH" and see if that path (e.g. /usr/local/bin) appears in the output separated by colons from other paths in the variable. If not you can append it to the PATH variable by typing "PATH=$PATH:/usr/local/bin" (/usr/local/bin is ONLY an example - you'd substitute whatever path alternatives was found in here).

If find does NOT show alternative then you need to install whatever package includes the command - go to rpmfind.net to locate this.

If the command IS found and IS in PATH then its likely number 3. You need to make it executable with the chmod command.
 
Old 11-19-2005, 10:30 PM   #3
timb5163
LQ Newbie
 
Registered: Aug 2005
Location: Iowa
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for the suggestions. I tried all of them and here is the response.


[root@Home timb]# find / -name alternatives
/etc/alternatives
/var/lib/rpm/alternatives
find: /proc/4645/task: No such file or directory
[root@Home timb]# PATH=$PATH:/etc/alternatives
[root@Home timb]# echo $PATH
/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/etc /alternatives
[root@Home timb]# alternatives --install /usr/bin/java java /usr/java/jre1.5.0_0 5/bin/ java 3
bash: alternatives: command not found

I went to /etc/alternatives and I don't find an alternatives command that I can change to executeable.

Timb
 
Old 11-19-2005, 10:32 PM   #4
timb5163
LQ Newbie
 
Registered: Aug 2005
Location: Iowa
Posts: 14

Original Poster
Rep: Reputation: 0
Also,

I tried installing chkconfig which is what someone told me has the alternatives command in it. When I install that rpm it tells me that it is installed already. I will try to uninstall and reinstall.
 
Old 11-20-2005, 12:01 AM   #5
springshades
Member
 
Registered: Nov 2004
Location: Near Lansing, MI , USA
Distribution: Mainly just Mandriva these days.
Posts: 317

Rep: Reputation: 30
Are you trying to install the JRE package of Java or the JDK? You want the JRE package if you just want to run java programs or enable java content in web pages and that sort of thing. You only need the JDK if you are actually planning on writing java software.

The reason I ask is I looked at the instructions page on the java site for installing JRE and they never use a command called alternatives that I can see. Are these the instructions you're following?

http://java.com/en/download/help/500...selfextracting
 
Old 11-20-2005, 09:21 AM   #6
timb5163
LQ Newbie
 
Registered: Aug 2005
Location: Iowa
Posts: 14

Original Poster
Rep: Reputation: 0
I am installing the JRE and those instructions work but you have to link java to the programs that you need it for. I wanted java to be available for any program that needs it. I found this post and it covered everything I wanted to do.

http://mandrivausers.org/index.php?showtopic=27828

I have seen alternatives being used in other instructions so I know it has to exist.

Thanks

Timb
 
Old 11-20-2005, 05:57 PM   #7
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
The command is 'update-alternatives', see
Code:
man update-alternatives
Also you don't need /etc/alternatives from your $PATH
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Some command not working in user using SU.. intercodes Linux - Newbie 4 12-10-2004 08:05 AM
Symbolic link in /etc/alternatives not working as intended davidas Debian 2 04-10-2004 07:09 PM
Working examples of dd command satimis Linux - Newbie 2 01-05-2004 07:23 AM
su command not working dahmad Linux - Newbie 6 02-28-2003 12:08 AM
ps command not working slackerboy Slackware 2 08-22-2002 11:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration