Results 1 to 10 of 10

Thread: update-alternative

  1. #1

    Default update-alternative

    Good Day Guys,

    just want to as about the following code


    Code:
    sudo update-alternatives -h
    result
    Code:
    sudo: update-alternatives: command not found
    can you help me about this, I want to use this command
    want to try Oracle JDK and this command is needed based on the instruction

    https://sites.google.com/site/easyli...a-for-opensuse

    Thanks in advance guys

    Long Live Linux and OpenSUSE

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: update-alternative

    Use
    Code:
    sudo /usr/sbin/update-alternatives -h
    if you want to use sudo.

    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
    nVidia ION | 3GB Ram

  3. #3
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: update-alternative

    Sorry i missed something, the command has no -h switch, what are you
    trying to do?

    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
    nVidia ION | 3GB Ram

  4. #4

    Default Re: update-alternative

    I included -h to know more about it
    like a help

    Long Live Linux and OpenSUSE

  5. #5

    Default Re: update-alternative

    Also, in windows there is what is called a "PATH" environment variable, you add the location of the app you want so that it can be ran on the command prompt
    is this possible on linux?
    if yes, how do I set this up? ex. this update-alternative, add this to the path variable to be ran directly to the command prompt

    Thanks in advance Sir

    Long Live Linux and OpenSUSE!!!

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: update-alternative

    On 2012-02-10 21:16, Jomar808 wrote:
    >
    > Also, in windows there is what is called a "PATH" environment variable,
    > you add the location of the app you want so that it can be ran on the
    > command prompt
    > is this possible on linux?


    Of course.

    > if yes, how do I set this up? ex. this update-alternative, add this to
    > the path variable to be ran directly to the command prompt


    The path is correctly set, don't change it.

    Simply, when you use sudo you are not yet root, so you have the path as
    correct for a plain user, not for root.

    If you get yourself root first, it works:

    Code:
    su -
    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  7. #7
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: update-alternative

    There are several things here which you need to see.

    1. there is absolutely no point in running an application as root just
    to get help
    Code:
    /usr/sbin/update-alternatives --help #as normal user
    man update-alternatives #as normal user for more help
    2. of course you can adjust your PATH
    Code:
    export PATH=/usr/sbin:$PATH
    put it for example into your ~/.profile
    you still need root rights for most of the functionality.

    3. make yourself familiar with the basics of linux, for example
    http://rute.2038bug.com/index.html.gz
    http://en.opensuse.org/SDBfficial_documentation
    and many more

    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
    nVidia ION | 3GB Ram

  8. #8
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: update-alternative

    On 02/10/2012 07:26 PM, Jomar808 wrote:
    > sudo update-alternatives -h


    NO! that page on google NOWHERE says to use "sudo update-alternatives"
    nor does it say you can get help by using "sudo update-alternatives -h"

    you _must_ be precise!

    evidently you have been exposed to Ubuntu which is NOT openSUSE... in
    Ubuntu they never use root and always use sudo....don't do that here..

    the command "update-alternatives" is given by root as

    Code:
    su -
    update-alternatives
    exit
    if you wish to add the help flag, do it the same way....but, MUCH more
    info on update-alternatives is available from its manual or help, thus:

    Code:
    su -
    man update-alternatives
    info update-alternatives
    actually, i'm not sure if one must be root to read the man and info for
    a root only command...i can read them on my machine as a normal user, so
    try it that way _first_..

    --
    DD http://tinyurl.com/DD-Caveat
    Read what Distro Watch writes: http://tinyurl.com/SUSEonDW

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: update-alternative

    On 2012-02-11 16:40, DenverD wrote:
    > actually, i'm not sure if one must be root to read the man and info for a
    > root only command...i can read them on my machine as a normal user, so try
    > it that way _first_..


    Information can be restricted, but to what point? You can have some manual
    pages readable only by root, but you can install the same system at home
    and read them, or even on internet. It is useless to restrict access to man
    pages.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  10. #10
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,806
    Blog Entries
    1

    Default Re: update-alternative

    You don't need to be root to read the MAN pages (and specifically update-alternatives).
    Also, newbies should know that the convention in openSUSE is to use double-hyphens, eg
    Code:
    $ update-alternatives --help
    BTW - Here is a mini-FAQ based on my personal use of update-alternatives...

    It's very rare when someone should need to setup an update-alternatives entry, more typically anytime a new option is installed properly into openSUSE, update-alternatives will be setup automatically for the User to switch between options.

    So, for me the most common use is to switch between various Java. Today, there is still some software that requires Sun Java SE 1.5, openJDK 1.6 is installed by default, and for various reasons you may need to have both JDK as well as JRE packages available on a system.

    Because JAVA is one of the groups supported by update-alternatives, all you need to do is install <all> the packages from both Sun/Oracle and the openSUSE repos you wish, and with the following command you can switch between any of them
    Code:
    $ update-alternatives --config java
    Cool, huh?

    The other command you might find useful is to list the various groups supported by update-alternatives
    Code:
    $ update-alternatives --get-selections
    HTH,
    TS

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •