How to run google Chrome browser on Gentoo

I started to write this post Jan 19,2011 and left it there until I finished it today.Delay caused by various reason..Yep almost six months…so..

My quest to run it(google chrome browser) on Gentoo get a step back when I saw that the source for that software were quite big and intimidating(almost 132MB!!) .So for a slow connection it is quite a heck of a job to fetch the source through emerge and then long long really long compile time on my Core 2 Duo processor.After a bit of search I came across an article shows me the different way of doing it.

So I am trying to follow that instruction and try it myself on my Gentoo box.Here we go:

Fist to get the unstable deb package from the google chrome site . Once you agreed to lincense it will give you the opportunity to download it.

So once I did that,means that package is downloaded then I started to work with it.I have downloaded it in the Download directory of my home .Here is the that :


bhaskar@bhaskar-laptop_09:36:22_Wed Jan 19:~/Downloads> ls
README_FIRST.txt feedjit.php feedjit.php.png feedjit.zip google-chrome-unstable_current_i386.deb

O yeah you are spotting it right ;it’s a Debian package.So let’s move on and unpack it.

bhaskar@bhaskar-laptop_09:39:33_Wed Jan 19:~/Downloads> ar x google-chrome-unstable_current_i386.deb

So running ar with option x inflated few files ..like below;


bhaskar@bhaskar-laptop_09:42:17_Wed Jan 19:~/Downloads> ls
README_FIRST.txt ar control.tar.gz data.tar.lzma debian-binary feedjit.php feedjit.php.png feedjit.zip google-chrome-unstable_current_i386.deb

Now we will explode the data section of the package like below:


bhaskar@bhaskar-laptop_09:46:41_Wed Jan 19:~/Downloads> tar xvf data.tar.lzma
./
./usr/
./usr/bin/
./usr/share/
./usr/share/man/
./usr/share/man/man1/
./usr/share/man/man1/google-chrome.1
./usr/share/gnome-control-center/
./usr/share/gnome-control-center/default-apps/
./usr/share/gnome-control-center/default-apps/google-chrome.xml
./usr/share/menu/
./usr/share/menu/google-chrome.menu
./usr/share/applications/
./etc/
./etc/cron.daily/
./etc/cron.daily/google-chrome
./opt/
./opt/google/
./opt/google/chrome/
./opt/google/chrome/product_logo_128.png
./opt/google/chrome/google-chrome
./opt/google/chrome/product_logo_24.png
./opt/google/chrome/libgcflashplayer.so
./opt/google/chrome/google-chrome.desktop
./opt/google/chrome/xdg-settings
./opt/google/chrome/chrome-sandbox
./opt/google/chrome/chrome
./opt/google/chrome/product_logo_16.png
./opt/google/chrome/chrome.pak

…..skim out for readability.So we got this listing ;


bhaskar@bhaskar-laptop_09:49:27_Wed Jan 19:~/Downloads> ls
README_FIRST.txt control.tar.gz data.tar.lzma debian-binary etc feedjit.php feedjit.php.png feedjit.zip google-chrome-unstable_current_i386.deb ls opt usr

Now we move the opt dir to the filesystem /opt location…

bhaskar@bhaskar-laptop_09:51:36_Wed Jan 19:~/Downloads> sudo cp -v opt/google/chrome/ /opt/ -r

Then link to /usr/bin

bhaskar@bhaskar-laptop_09:57:34_Wed Jan 19:/opt/chrome> sudo ln -s chrome /usr/bin/

Now the crucial jon at hand to link the library manually..if you made little mistake it will comaplain. Here we go:

bhaskar@bhaskar-laptop_09:57:34_Wed Jan 19:/opt/chrome> sudo ln -s chrome /usr/bin/
bhaskar@bhaskar-laptop_09:57:58_Wed Jan 19:/opt/chrome> sudo ln -s /usr/lib/nss/libnss3.so.12 /usr/lib/libnss3.so.1d
bhaskar@bhaskar-laptop_10:00:41_Wed Jan 19:/opt/chrome> ln -s /usr/lib/nss/libnssutil3.so.12 /usr/lib/libnssutil3.so.1d
ln: failed to create symbolic link `/usr/lib/libnssutil3.so.1d': Permission denied
bhaskar@bhaskar-laptop_10:01:24_Wed Jan 19:/opt/chrome> sudo ln -s /usr/lib/nss/libnssutil3.so.12 /usr/lib/libnssutil3.so.1d
bhaskar@bhaskar-laptop_10:01:33_Wed Jan 19:/opt/chrome> sudo ln -s /usr/lib/nss/libsmime3.so.12 /usr/lib/libsmime3.so.1d
bhaskar@bhaskar-laptop_10:02:07_Wed Jan 19:/opt/chrome>
bhaskar@bhaskar-laptop_10:02:07_Wed Jan 19:/opt/chrome> sudo ln -s /usr/lib/nss/libssl3.so.12 /usr/lib/libssl3.so.1d
bhaskar@bhaskar-laptop_10:02:30_Wed Jan 19:/opt/chrome> sudo ln -s /usr/lib/nspr/libplds4.so.7 /usr/lib/libplds4.so.0d
bhaskar@bhaskar-laptop_10:05:00_Wed Jan 19:/opt/chrome> sudo ln -s /usr/lib/nspr/libplc4.so.7 /usr/lib/libplc4.so.0d
bhaskar@bhaskar-laptop_10:05:32_Wed Jan 19:/opt/chrome> sudo ln -s /usr/lib/nspr/libnspr4.so.7 /usr/lib/libnspr4.so.0d

Ok ,done the hard work..it’s time to launch it from the terminal first..but wait it was throwing some errors!! So I was not able to run it successfully.And not looked at it for long time due to various reasons.

Now I have stumbled over some article in the net and which tell that chromium is available from the standard repo.So I do not waste my time and start to fetching it…as mentioned above it takes long time with the slow connection.Patience is the key.So got this first time;

bhaskar@bhaskar-laptop_09:11:48_Sat Jun 18:~> sudo emerge -av chromium
Password:

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no ebuilds built with USE flags to satisfy ">=media-video/ffmpeg-0.6_p25767[threads]".
!!! One of the following packages is required to complete your request:
- media-video/ffmpeg-0.6_p25767 (Change USE: +threads)
- dev-libs/libxml2-2.7.8 (Change USE: +icu)
(dependency required by "www-client/chromium-11.0.696.71" [ebuild])
(dependency required by "chromium" [argument])

Then as usual I put the required thing in /etc/portage/package.use and fetch the required software thorough emerge.

Okay,once done I started to fetch Chromium from the repo like below:

bhaskar@bhaskar-laptop_09:50:13_Sat Jun 18:~> sudo emerge -av chromium
Password:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] media-libs/libvpx-0.9.5 USE="threads (-altivec) -debug -doc -mmx -postproc -sse -sse2 -sse3 -ssse3" 1,222 kB
[ebuild N ] media-libs/speex-1.2_rc1 USE="ogg -sse -static-libs" 1,037 kB
[ebuild N ] www-client/chromium-11.0.696.71 USE="cups gnome gnome-keyring -test" 141,781 kB

Total: 3 packages (3 new), Size of downloads: 144,039 kB

Would you like to merge these packages? [Yes/No] y

Now once it done( O yeah! after waiting for the source to get downloaded with a slow conn!),I was trying to get it run from the standard gnome menu.But was not coming up.So the next natural instinct come into play to see it on the terminal by running that binary. Yep! it does reveal some output ,which made me think what is causing this..although I can have everything in place..here is the output it is throwing :


bhaskar@bhaskar-laptop_18:15:58_Sat Jun 18:~> sudo /usr/bin/chromium
Password:
chromium-browser: /opt/xulrunner/libnss3.so: version `NSS_3.12.3' not found (required by chromium-browser)
chromium-browser: /opt/xulrunner/libnss3.so: version `NSS_3.12' not found (required by chromium-browser)

Many of you might find it very easy to resolve it,my case was different(as I am not blessed with sharp brain) so takes time for me to find out what exactly going on.After some googling and hovering over my system to lookout for some specific details here and there ,I found out that the culprit is “xulrunner-bin“,which is restricting the chrome binary to see the right NSS version.

So the next obvious step would be to get rid of it from the system,because it is interfering with other program to run properly.


bhaskar@bhaskar-laptop_18:25:47_Sat Jun 18:/opt/xulrunner> sudo emerge -C xulrunner-bin
Password:
* This action can remove important packages! In order to be safer, use
* `emerge -pv --depclean ` to check for reverse dependencies before
* removing packages.

net-libs/xulrunner-bin
selected: 1.8.1.19
protected: none
omitted: none

All selected packages: net-libs/xulrunner-bin-1.8.1.19

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging net-libs/xulrunner-bin-1.8.1.19...

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

* GNU info directory index is up-to-date.

Huh! once done ..I can get chromium running fine on Gentoo..yay!!!

Here is the screenshot of it:

Hope this will help.

Cheers!
Bhaskar

About unixbhaskar
GNU/Linux Consultant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: