Installing Google Chrome on Clear Linux*

Step by step process

  1. Open a terminal

  2. Run the following command to obtain root privileges

    sudo -s
    

    and type your admin password.

  3. Run the following commands, one by one:

    swupd bundle-add package-utils
    curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
    sudo rpm --import https://dl-ssl.google.com/linux/linux_signing_key.pub
    rpm -U --nodeps google-chrome*.rpm
    sed -i 's\/usr/bin/google-chrome-stable\env FONTCONFIG_PATH=/usr/share/defaults/fonts /usr/bin/google-chrome-stable\g' /usr/share/applications/google-chrome.desktop
    
  4. Now you can delete the .rpm package and, if you don’t need it, the package-utils bundle. To do this run the following commands, one by one:

    rm -f google-chrome*.rpm
    swupd bundle-remove package-utils
    

Done!

Updating Google Chrome

To update Google Chrome you can re-follow the procedure above, or periodically run it in a script.

Uninstalling Google Chrome

  1. Open a terminal

  2. Run the following command to obtain root privileges

    sudo -s
    

    and type your admin password.

  3. Run the following commands, one by one:

    swupd bundle-add package-utils
    rpm -e google-chrome-stable
    
  4. Now if you don’t need it you can delete the package-utils bundle by running:

    swupd bundle-remove package-utils
    

Done!

Let me know your thoughts, and if there’s something that can be improved, especially about the dependecies, since Chrome is installed using --nodeps.

I hope it’s helpful! :smile:

9 Likes

To install the first time, the last line of step 3 should read:

rpm -i --nodeps google-chrome*.rpm

(At least, I needed to use -i instead of -U :upside_down_face:)

rpm -U should work for updating later on.

Hi @a-lakhani, welcome to the Clear Linux* Forum! :smile:

That’s strange, I explicitly wrote rpm -U because it’s more generic and works in both cases. I just retried installing Chrome using rpm -U and it “worked”. I get some errors and warning obviously:

# rpm -U --nodeps google-chrome*.rpm
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
/var/tmp/rpm-tmp.khWS37: riga 612: /etc/default/google-chrome: File o directory non esistente
/var/tmp/rpm-tmp.khWS37: riga 615: /etc/default/google-chrome: File o directory non esistente
warning: %post(google-chrome-stable-77.0.3865.90-1.x86_64) scriptlet failed, exit status 1

but — I think — that’s because rpm is not the proper way to install apps on Clear. Those errors shouldn’t compromise the installation and I still found Google Chrome between the installed apps after running the scripts.

Oops! :flushed: I saw “scriptlet failed” and assumed it didn’t “work,” I didn’t actually check if Chrome was in the installed apps after I saw the error.

Thanks for the welcome, I’m sure there will be many more such lessons as I play around with Linux!

1 Like

This worked for me. I had to add/activate a keyring in Seahorse.

But have you seen this:
http://ftp.rpm.org/max-rpm/s1-rpm-install-additional-options.html#S2-RPM-INSTALL-NODEPS
" Whether it will work properly is another matter, but it is installed. In general, it’s not a good idea to use –nodeps to get around dependency problems."

How do you guys get hardware decoding to work on Chrome?

Chrome works well for me out of the box, in comparison to Firefox, it plays videos and GIFs by default. If you are talking about the Accelerated Video Decode feature in chrome://gpu, it’s unavailable on GNU/Linux. Maybe you can find more info here.

I saw answer from a Clear Linux developer that you don’t include Google Chrome as you are not allowed to repackage their binary.
Please add a Google Chromium bundle as so many other distros do https://chromium.googlesource.com/chromium/src/+/master/docs/linux_chromium_packages.md

/Christian

Or even better :

Lighter, more private, and especially… faster !

1 Like

Thanks for sharing this! The portable version of this is perfect for running from a user folder.

1 Like

You may have issues with fonts after installing this from the first post.

To get this working on a new install I had to rename the /etc/environment (created in step 5) file to /etc/profile

Now everything works!

this sounds like a bug. /etc/environment should set up environment variables for every user accounts,

When I put something in that file it is not present in my environment variables.

According to man environment,

The /etc/environment file specifies the environment variables to be set. The file must consist of simple NAME=VALUE pairs on separate lines. The
pam_env(8) module will read the file after the pam_env.conf file.

I’ll try figure out why that’s not working but on a fresh install of clear Linux on two laptops I wasn’t getting that behaviour.

1 Like

I have an alternative tutorial for this problem using dnf.

  • First install the dnf using

sudo swupd bundle-add dnf

  • After, add the Clear Linux repo using
sudo cat << EOF > /etc/yum.repos.d/clearlinux.repo
[clearlinux]
name=Clear Linux Packages
baseurl=https://download.clearlinux.org/current/x86_64/os/
gpgcheck=0
EOF
  • And add the Google Chrome repo
sudo cat << EOF > /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub
EOF
  • Use the command bellow

sudo dnf update

  • And finally install Chrome

sudo dnf install google-chrome-stable

Beta google-chrome-beta and unstable google-chrome-unstable packages.

  • To update just use

sudo dnf update

Hope this helps =)

3 Likes

To get rid of this error:

warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY

use:

sudo rpm --import https://dl-ssl.google.com/linux/linux_signing_key.pub
2 Likes

The fonts command did nothing for me, but do this and enjoy:
sudo sed -i "s|Exec=/usr/bin/google-chrome-stable|Exec=/usr/bin/google-chrome-stable --password-store=basic %U|g" /usr/share/applications/google-chrome.desktop
For kde and gnom it uses by default these wallets - finally no longer.
--password-store=<basic|gnome|kwallet> Set the password store to use. The default is to automatically detect based on the desktop environ‐ ment. basic selects the built in, unencrypted password store. gnome selects Gnome keyring. kwal‐ let selects (KDE) KWallet. (Note that KWallet may not work reliably outside KDE.)

Tutorial updated! :grin:

I fixed the fonts fixed by setting the environment variable in the google-chrome.desktop file.

2 Likes

Thanks @leandromqrs!

However, I’m not sure about adding the Clear Linux repo on dnf. If I start the installation it will add redundant dependencies already present on my system.

Is swupd still working after this?