0

I have download firefox version 34 from Mozilla website.

Next, I extracted the tar archive, and moved it to the Desktop.

Now, when I run the following command:

Desktop/firefox/firefox

the version of firefox which I have downloaded gets run (34.0.5), but when I run this command:

firefox

The old firefox (3.4) gets run. I want to update make firefox command to run the latest version downloaded, so I do this:

ln -s /bin/firefox/firefox Desktop/firefox

Nothing happens, what should I do?

  • alias firefox='/home/your_user_name/Desktop/firefox/firefox' - put it in your .bashrc and then firefox will always run the version that you have on your desktop. – don_crissti Dec 18 '14 at 11:26
  • @n.st - always in the context "I want to make firefox command to run the latest version downloaded" (i.e. command in terminal). It is not clear whether the OP wants to run the local version of FF only when launched from terminal. Ideally I'd make my own launcher in $XDG_DATA_HOME with Exec=/path/to/new/firefox and make sure that path is first in $PATH. – don_crissti Dec 18 '14 at 14:19
3

There are two ways to fix this:

  1. You can alter your $PATH variable so that the directory where the new firefox version lives is checked before any other directory, by running the command
    export PATH=$HOME/Desktop/firefox:$PATH
    And if you add that same command to your .bashrc, all your future sessions will have the new PATH too.
  2. You can use ln to symlink the new version into a directory that is already in your PATH. First, check where the old version lives by doing which firefox. If I do that on my computer, I get this:
    jenny@sameen > which firefox
    /usr/bin/firefox
    
    This means that I need to remove the existing /usr/bin/firefox and replace it with a symlink to the new version. That's what you tried - but the way that you wrote the command is wrong. the right syntax would be
    sudo ln -fs $HOME/Desktop/firefox/firefox /usr/bin/firefox
    The flag -f means "if there already exists a /usr/bin/firefox, remove it and replace it with this link", and the s means "make it a symbolic link, not a hardlink`.

Note that if this server is being used by other people than yourself, this could cause problems for them, because they may not be able to use a program that lives in your home directory. If so, you should either move the binary to e.g. /usr/local/firefox before symlinking, or you should use the first solution above and simply modify your own $PATH.

2

Easiest way

apt-get install firefox this will update to new one

or

which firefox this will give you path of firefox

then replace the same

sudo ln -fs $HOME/Desktop/firefox/firefox /usr/bin/firefox

For Ex.

which firefox /usr/bin/firefox sudo ln -fs $HOME/Desktop/firefox/firefox /usr/bin/firefox

  • 2
    I don't think RHEL uses apt – n.st Dec 18 '14 at 13:49
  • Op doent mention a flavour so yum ll be der for rhel – Security Beast Dec 18 '14 at 19:32
1

Why you downloaded the version, you apparently did not install it in one of the directories in the PATH variable. When you execute simply 'firefox' it will find firefox in the first directory using the PATH directory. If you execute firefox with a more fully qualified name it will use whatever is found in that SPECIFIC directory only.

The easiest thing to do would be to put the directory where the new version of firefox resides in your PATH before everything else.

0

You are just using ln the wrong way around: ln is ln <source> <target>.

So you could do:

ORIGINAL="$(which firefox)"
sudo mv "$ORIGINAL" "${ORIGINAL}.orig"
sudo ln -s "$HOME/Desktop/firefox/firefox" "$ORIGINAL"

This will backup the current firefox binary from your path and create a symlink to your manually installed version.

  • 1
    The second $(which firefox) should evaluate to an empty string after you've moved it to $(which firefox).orig in the first command. You could however store the original firefox path in a variable and use that instead. – n.st Dec 18 '14 at 13:55
  • Correct, I'll fix that. First I had only the ln -sf, but then decided to save the original... – Martin C. Dec 18 '14 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.