FireFox 4

If you just download the firefox tar, then you’ll get an error:

 ./firefox-bin: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

or

./firefox-bin: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /home/cameron/firefox/libxul.so)

To fix this follow these steps.

cd ~
download the file: firefox-4.0.tar.bz2
tar xvf firefox-4.0.tar.bz2
cd firefox
download the fedora rpm: libstdc++
rpm2cpio libstdc++-4.3.0-8.i386.rpm | cpio -i --make-directories
#note the lack of / at front of usr/lib in the line below
mv usr/lib/libstdc++.so.6* .
rmdir usr/lib usr

hope that helps..

Cameron
Check out my new HTML5 app at: http://imagebot.com

22 Comments

  1. Amit says:

    Thanks Cameron!.This helped me to move a bit for getting firefox 4 on CentOS 5.5 working.

    1)Downloaded firefox and unzipped and then untarred it. 
    2)downloaded libstdc++-4.3.0-8.x86_64.rpm at /home/dev/Desktop. Then switched to root
    3)rpm2cpio libstdc++-4.3.0-8.i386.rpm | cpio -i –make-directories
    4)mv usr/lib/libstdc++.so.6* .
    

    This is telling me
    mv: cannot stat `usr/lib/libstdc++.so.6*’: No such file or directory
    However, i ran above command with /usr
    will that break anything :-O

    by rmdir usr/lib usr

    are you trying to delete /usr/lib

  2. cameron says:

    libstdc++.so.6* is from the downloaded rpm .. when you rpm2cpio it, you are unbundling it .. it will have this file in usr/lib dir … so for you
    /home/dev/Desktop/usr/lib/libstdc++.so.6*

    There are two files .. if there aren’t then run the rpm2cpio command again.

    yes the /usr/lib dir will break things.

    hope that helps.

    Cameron

  3. ben says:

    Thanks for the post, so much time saved versus trying to build firefox!

  4. sam says:

    Thanks ,, this certainly helped me …

    Initially on my system firefox was getting stalled. with following message

    version `GLIBCXX_3.4.9′ not found (required by /usr/local/firefox/libxul.so)
    [ NOTE : this too after unpacking libstdc++-4.3.0-8.i386.rpm with cpio and linking with
    LD_LIBRARY_PATH ]

    One thing that I have done along with performing above said steps is —
    I have put one soft link of new libstdc++ lib at home dir of firefox.

    And that has solved my problem.

  5. cameron says:

    yeah , I don’ t know why LD_LIBRARY_PATH doesn’t work, but it doesn’t.

    sym link also works! Actually, that might make the instructions more clear (and less dangerous!)

    Cameron

  6. Saghalie says:

    Worked like a charm! Thanks so much.

    One issue that I did run in to though was the
    rpm2cpio libstdc++-4.3.0-8.i386.rpm | cpio -i –make-directories
    command.

    I had to change it to read
    rpm2cpio libstdc++-4.3.0-8.i386.rpm | cpio -i -–make-directories
    in order for it to work.

    Thanks!

    Saghalie
    http://www.kcmhosting.com

  7. pavi says:

    it’s working fine, thanks a lot.

    I have faced the same issue like Saghelie, thanks for spoting it.

  8. Manuel says:

    Thank you Cameron for this simple & fully functional guide. I just added a few steps:
    (as root user)

    # cd ..
    # # Move the recently unzipped firefox directory
    # mv firefox /usr/local/lib/firefox-4.0
    # cd /usr/bin
    # mv firefox firefox-3
    # ln /usr/local/lib/firefox-4.0/firefox .

    This will allow you to execute firefox 4 by clicking your (old) desktop icons or application launchers.

  9. Abid says:

    I have tried each step but at the end
    rmdir usr/lib usr is giving me some problem
    it says usr directory is not empty .
    So what i have to do ?? please help

  10. Abid says:

    Finally Cracked it 🙂 Thanks a lot

  11. cameron says:

    great. If the instructions were not correct, please let me know. Or even perhaps where I should highlight something to make it clearer!

    thanks…

  12. Juan Martinez says:

    It works, but firefox-4.0.1 produces error reporting agent
    when I close firefox window.

    It always produces this agent.

  13. Juan Martinez says:

    The false thing is as follows.

    If I close firefox 4 window, it ALWAYS produces
    Mozilla Error Report Agent.
    We need to examine it.

    strace ./firefox
    —————————– STRACE ——————————
    close(17) = 0
    close(15) = 0
    munmap(0xacffe000, 8392704) = 0
    munmap(0xb4698000, 3529238) = 0
    close(23) = 0
    close(24) = 0
    unlink(“/home/suhopark/.mozilla/firefox/hrpd1l3z.default/lock”) = 0
    write(2, “\n(Gecko:11113): GLib-CRITICAL **”…, 87
    (Gecko:11113): GLib-CRITICAL **: g_hook_alloc: assertion `hook_list->is_setup’ failed
    ) = 87
    — SIGSEGV (Segmentation fault) @ 0 (0) —
    prctl(0x4, 0x1, 0xb5d02220, 0xac, 0) = 0
    gettid() = 11113
    mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb51f5000
    pipe([15, 16]) = 0
    clone(child_stack=0xb51f6f2c, flags=CLONE_FS|CLONE_FILES|CLONE_UNTRACED) = 11138
    prctl(0x59616d61, 0x2b82, 0, 0, 0) = -1 EINVAL (Invalid argument)
    write(16, “a”, 1) = 1
    waitpid(11138, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], __WALL) = 11138
    close(15) = 0
    close(16) = 0
    gettimeofday({1304571341, 572489}, NULL) = 0
    open(“/home/suhopark/.mozilla/firefox/Crash Reports/LastCrash”, O_WRONLY|O_CREAT|O_TRUNC, 0600) = 15
    write(15, “1304571341”, 10) = 10
    close(15) = 0

  14. krishna says:

    Thanks… it helped me to bring up without big hazzles.

    Initially when copied pasted directly the following command , it was not working

    “rpm2cpio libstdc++-4.3.0-8.i386.rpm | cpio -i -–make-directories” , since the –make-directories came up as single big – (some other symbol) on my terminal.

    Later replaced it with — and found working

  15. krishna says:

    I think it is browser issue , please replace — with two -‘s

  16. cameron says:

    thanks krishna, hopefully the new font is better.

  17. reece says:

    Can I help with this please?

    When I do this step: mv usr/lib/libstdc++.so.6*

    I get this: mv: `usr/lib/libstdc++.so.6′ and `usr/lib/libstdc++.so.6.0.10′ are the same file

    Am I missing something here? I’m a complete noob, are there any other steps or something else I need to add to your commands? where do I move what to?

    I tried this and overwrote libstdc++.so.6 : mv usr/lib/libstdc++.so.6.0.10 /usr/lib/libstdc++.so.6

    Is it broken now?

  18. reece says:

    ^Sorry I meant can I GET help please 😉

  19. cameron says:

    reece, you need the . at the end, it means copy to the current directory (so you have to be in the correct directory)

  20. ben says:

    Thanks for the tip!
    It works even for firefox 5.0.1

  21. Praveen says:

    Hi Cameron,

    I need logo generator script. Is something for sale ? Or do you have any API access for that ? Much appreciated your help. Kindly get back to me. Thanks

    -Praveen

  22. cameron says:

    I replied in a few other places. Let me know if you still have any questions (but the contact form/email is better) – Cameron

Leave a Reply