Skip to content

How to Install Firefox in Linux

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #191682
    imFiles
    Member

    A Tutorial: Howto Install Firefox in Linux

    I would normally recommend you install software through the software manager of the distribution of your choice. It’s easier that way, just a few ‘clicks’, and any software you install will be updated regularly along with the rest of your OS — very cool! However, every now and again there will be a program which is not provided in your distro’s software repository. In that case, you’ll need to know how to install software in a logical, proper, and secure way. That being said, let’s get to the tutorial.

    First, download a copy of the latest Firefox installer for Linux. The Firefox installer is compressed as a tar.gz archive, which is the most common format for Linux compressed archives. We’ll need to uncompress the archive before we can run the installer. We could do this graphically, using the ‘ark’ program, but let’s do it from the command line for simplicity’s sake. Start a terminal. At the command prompt, type:
    Code:

    tar xzvf firefox-1.0.3-installer.tar.gz

    …assuming of course that you downloaded it to the root directory of your home, and that the version you’ve downloaded happens to be 1.0.3. Since users in a Unix-like system can only write to their home directory by default, you will need root (administrator) privileges for the rest of this exercise. Get root access by typing:
    Code:

    su – root

    …and entering your root password. Next, you will want a folder in which to keep your manually-installed applications. To me, “apps” makes sense for the folder name, so let’s go with that. Type the following in the terminal:
    Code:

    mkdir /usr/local/apps

    Now, we’ll want to install Firefox there. Change directories into the Firefox installer’s folder, and run the installer by typing the following:
    Code:

    cd firefox-installer sh firefox-installer

    You’ll be presented with a lovely installer GUI, in which you’ll gleefully click ‘next’ until you come to the screen in which it’s asking where you’d like it be installed. In that path, you’d make it:
    Code:

    /usr/local/apps/firefox-1.0.3

    …assuming the version you’re installing is 1.0.3 of course. Once the installation is complete, a new Firefox window will open. Success! Close the Window now without doing any surfing (you’re still running it as root, remember?). Now we’ve installed Firefox to a place on the system which makes sense, and in which normal users can run firefox normally, save their settings, install extensions & skins, etc., yet cannot actually harm the Firefox program in any way. However, it’s still not convenient for users to run Firefox at this stage; they’d have to type /usr/local/apps/firefox-1.0.3/firefox every time they wanted to run it. Not exactly efficient.

    Next, we’ll concentrate on making Firefox easy to run and simple to upgrade. For that, you’ll be introduced to symbolic links. Symbolic links are a pretty cool feature of Unix-like systems that makes things a lot easier on everybody. The gist is that you make a placeholder that points a file’s true location to a more convenient location. This affords us the best of both worlds — convenience and organization. First, for simplicity, we’ll CD to the apps directory:
    Code:

    cd /usr/local/apps

    Now we will make a link from firefox-1.0.3 to simply firefox:
    Code:

    ln -s firefox-1.0.3 firefox

    At this point, a user could execute Firefox by typing /usr/local/apps/firefox/firefox …starting to get it? OK, well obviously nobody wants to type the full path every time, even thus shortened. So we’re going to make yet another symbolic link:
    Code:

    ln -s /usr/local/apps/firefox/firefox /usr/local/bin/firefox

    Now there’s a link to the Firefox executable in the folder /usr/local/bin/, which is called ‘firefox’. Since /usr/local/bin is in the user’s path, all a user has to do to execute Firefox now is type firefox, no matter which directory they’re in! Simple?

    Mandrake-Specific Info:
    Now, you probably want a nice icon that represents Firefox so you don’t have to type the command in the shell every time, even though we’ve made it a lot easier. This will vary a bit from distro to distro, but in Mandrake Linux you’d type (as root still):
    Code:

    menudrake

    …since you’re running as root, you’ll be prompted as to whether or not you want to edit the system-wide menu, or just the ‘root’ user’s menu. Choose ‘system’. Now, expand the ‘Internet’ section. Highlight ‘Web Browsers’. Click ‘Add Application’, for the title type firefox and for the description, Firefox. Now for the pretty icon. Click on the button which says ‘No Icon’, and for the path choose ‘Browse custom directory’. Browse to /usr/local/apps/firefox/icons/, and hit ‘Open’. Choose mozicon50.xpm (aka the big one). Hit the ‘Save’ button. It’ll take a second to rebuild the menu system. You’re done, you can close out menudrake now and log out of your root account by typing exit a few times. If you want an icon on your desktop now, just open your menu and drag your freshly baked Firefox link right onto your desktop. There you go!

    Now, since you’ve got some symbolic links in place, all you have to do in order to upgrade Firefox to a new version is make a new folder for the updated version in /usr/local/apps/, just like you did for the first one (e.g. /usr/local/apps/firefox-1.0.4/). All we have to do is delete the symbolic link which links /usr/local/apps/firefox-1.0.3 –> /usr/local/apps/firefox, then make a link to the new version:
    Code:

    rm -rf /usr/local/apps/firefox ln -s /usr/local/apps/firefox-1.0.4 /usr/local/apps/firefox

    You don’t have to remake any of your other links or icons, because your symbolic link, /usr/local/bin/firefox, points to /usr/local/apps/firefox/firefox, which hasn’t changed at all. Also, by using the same procedure detailed above and simply making a few logical adaptations, you can do the same thing with Thunderbird and many other applications.

    for lunch. Liberty is a well-armed lamb contesting the vote.” -Benjamin Franklin

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.