One of my friend was trying to see , which rpm/package provide /usr/bin/java in his system by below method..
[terminal]
[root@ ~]# which java
/usr/bin/java
[root@ ~]# rpm -qf /usr/bin/java
file /usr/bin/java is not owned by any package
[root@ ~]#
[/terminal]
Its a common practice that checking a particular file/binary is provided by which rpm using rpm command as shown above.
But what will you do if you see the message like “is not owned by package” ? .. In such situations ,you have to look into something called “alternatives” .
Some of the binaries can be configured using “alternatives” ..
[terminal]
alternatives – maintain symbolic links determining default commands
[/terminal]
alternatives creates, removes, maintains and displays information about the symbolic links comprising the alternatives system.
The alternatives system is a reimplementation of the Debian alternatives system. It was rewritten primarily to remove the
dependence on perl; it is intended to be a drop in replacement for Debian’s update-dependencies script. This man page is a
slightly modified version of the man page from the Debian project.
It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same
time. For example, many systems have several text editors installed at once. This gives choice to the users of a system,
allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice of editor to
invoke if the user has not specified a particular preference.
PLEASE READ man page of alternatives for more details on this ..
Alternatives got below options with it.
[terminal]
alternatives version 1.3.49.3 – Copyright (C) 2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: alternatives –install <link> <name> <path> <priority>
[–initscript ]
[–slave <link> <name> <path>]*
alternatives –remove <name> <path>
alternatives –auto <name>
alternatives –config
alternatives –display <name>
alternatives –set <name> <path>
common options: –verbose –test –help –usage –version
–altdir –admindir
[root@ ~]#
[/terminal]
Now something like below, can be tried.
[terminal]
[root@ ~]# alternatives –config java
There are 3 programs which provide ‘java’.
Selection Command
——————————
+ 1 /usr/lib/jvm/jre-1.6.0-
* 2 /usr/lib/jvm/jre-1.6.0-sun.
3 /usr/lib/jvm/jre-1.5.0-gcj/
[terminal]
If you want to know which PACKAGE provides above binaries , go for “rpm command” now with the links you got from above..
Thanks a lot for this post.. I was irritated by seeing this ( ‘file is not ….) error message till now.. 🙁