How can I install Google Chrome on Fedora without any issues?

0

I would like to install Google Chrome on Fedora. But I couldn't get the file I downloaded from Google's website to work, and there's too much confusing and sometimes even conflicting information about how to install it from the command line. What is the definitive answer to easily install Chrome on Fedora 22?

Hayden Schiff

Posted 2015-08-26T02:14:50.157

Reputation: 253

Answers

0

Here is a series of commands you can run on Fedora to install Google Chrome in one swell foop. Just copy these 10 lines, open Terminal, and paste them in (Ctrl+V won't work; right-click and hit Paste, or middle-click):

cat << EOF | sudo tee /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - \$basearch
baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF
sudo yum install google-chrome-stable
sudo sed -i.bak '/\[Desktop Entry\]/a StartupWMClass=Google-chrome-stable' /usr/share/applications/google-chrome.desktop

To make these updates kick in immediately, press Alt+F2 and type r to make GNOME restart. (otherwise, GNOME will probably update on its own in short time, or the next time you restart your PC)

These commands have only been tested on Fedora 22, but they should theoretically work on past or future versions of Fedora as well. They might even work on other OSes that use RPM.


If you're curious, here's what's going on here. The first 8 lines add the official Google Chrome repository to Yum's list of repositories. The 9th line then installs Google Chrome using Yum. The last line edits Chrome's .desktop file (which is the file that adds Google Chrome to your application launcher) to fix an issue where Chrome would launch as "Google-chrome-stable" and you'd have two different icons in your dock and it just looked silly.

All of this info was originally posted here on GitHub Gist.

Hayden Schiff

Posted 2015-08-26T02:14:50.157

Reputation: 253