How to Install Google Chrome on Rocky Linux 9 or 8

Google Chrome stands out as a leading web browser, renowned for its speed, security, and extensive feature set. Technical highlights of Chrome include its V8 JavaScript engine for rapid script processing, sandboxing technology for enhanced security, and seamless synchronization across devices using a Google account. Additionally, Chrome supports a vast ecosystem of extensions, offering users the ability to customize and enhance their browsing experience.

For users on Rocky Linux 9 or 8, installing Google Chrome can be achieved through multiple methods. You can utilize the command-line terminal to download and install Google’s official RPM packages, available in Stable, Beta, or Unstable (Dev) builds. Alternatively, Flatpak with Flathub offers installations of the Stable or Unstable builds. This guide will detail both approaches, ensuring you have access to the version of Chrome that aligns with your preferences.

Method 1: Install Google Chrome via Google’s RPM

Update Rocky Linux System Before Google Chrome Installation

Before we initiate the process of installing Google Chrome, we must make sure that our system packages are updated. The rationale for this action is to avoid potential conflicts during the installation process and maintain the optimal performance of your system. For this, we will use the following command:

sudo dnf upgrade --refresh

This command ensures that all the packages in your Rocky Linux system are updated, paving the way for a smooth installation process.

Import Google Chrome RPM

As a Google Chrome user, you can choose from three distinct variants of the browser: Stable, Beta, and Unstable. The Stable version is recommended for most users, while the Beta and Unstable versions are more suited for advanced users willing to experiment and explore new features.

Before initiating the installation process, we must import the GPG key, which helps validate the software packages’ authenticity. You can achieve this using the following command:

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

Note: You might encounter an error during this process if you’re a Rocky Linux 9 user. The error manifests itself as follows:

[joshua@rocky-linux ~]$ sudo rpm --import https://dl.google.com/linux/linux_signing_key.pub
warning: Signature not supported. Hash algorithm SHA1 not available.
error: https://dl.google.com/linux/linux_signing_key.pub: key 2 import failed.

Rocky Linux 8 users need not perform the command above unless they encounter the error. This error is predominantly encountered in Rocky Linux 9 and onward.

We need to adjust your system’s cryptographic policies to rectify this error. Specifically, we will set the policy to ‘LEGACY’ with the following command:

sudo update-crypto-policies --set LEGACY

Upon executing this command, it’s advisable to reboot your system to ensure the changes take effect. While this isn’t mandatory, it’s highly recommended, especially if you face any issues. You can reboot your system using:

reboot

Finalize Google Chrome Installation via DNF Command

We can now install the Google Chrome browser after ensuring your system is up-to-date and the Google Chrome DNF repository has been incorporated. Here, you can choose between the browser’s stable, beta, or unstable versions. Each version can be installed using the respective commands:

sudo dnf install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm -y
sudo dnf install https://dl.google.com/linux/direct/google-chrome-beta_current_x86_64.rpm -y
sudo dnf install https://dl.google.com/linux/direct/google-chrome-unstable_current_x86_64.rpm -y

Please note that the beta and unstable versions are not recommended for everyday use. See below for an alternative installation method.

Method 2: Install Google Chrome via Flatpak and Flathub

In this section, we will focus on using Flatpak and Flathub to install Google Chrome on Rocky Linux 9 or 8 as a secondary installation method.

Flatpak is a universal package management system that aims to offer applications that work on any Linux distribution. It encapsulates applications in isolated environments, minimizing potential conflicts with system libraries. Complementing Flatpak is Flathub, which is a centralized repository for Flatpak applications. It functions as a one-stop shop, hosting many applications readily available for installation.

Enable Flathub for Google Chrome

Before starting the installation process, we must ensure the Flathub repository is enabled. This allows us to access and install applications hosted on Flathub, including Google Chrome.

To enable Flathub, you need to execute the following command in your terminal:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

This command enables the Flathub repository in your Flatpak configuration, granting you access to an extensive range of applications.

Install Google Chrome via Flatpak Command

With Flathub enabled, we can forge ahead with installing Google Chrome on Rocky Linux 9 or 8. The flatpak install command comes in handy for this operation.

Install Google Chrome stable or unstable

The stable version of Google Chrome is the most recommended for regular use. It provides a seamless browsing experience with tested and proven features. To install the stable version, you need to run the following command in your terminal:

flatpak install flathub com.google.Chrome -y

To install the unstable version, execute this command in your terminal:

flatpak install flathub com.google.ChromeDev

Please note that the Flatpak and Flathub systems do not support beta versions of Google Chrome. Therefore, only the stable and unstable versions are available for installation through this method.

Initiating Google Chrome via CLI or GUI

After successfully installing Google Chrome on your Rocky Linux system, the next important step is to launch it. Several methods are available to initiate Google Chrome, depending on your preference and familiarity with the command line or graphical user interface.

CLI Commands to Launch Google Chrome Browser

For users comfortable with the terminal or running a headless server, the command-line interface (CLI) method would be most appropriate. Here, each version of Google Chrome that is installed has a unique command.

Stable Version

To open the stable version of Google Chrome installed via DNF, the command you would use is:

google-chrome

The command to launch the stable version of Google Chrome installed via Flatpak is:

flatpak run com.google.Chrome

Beta Version

The command to launch Google Chrome Beta installed via DNF only is:

google-chrome-beta

Unstable Version

For those who installed the unstable build of Google Chrome, the command is:

google-chrome-unstable

To launch the unstable version of Google Chrome installed via Flatpak, the command you would use is:

flatpak run com.google.ChromeDev

GUI Method to Launch Google Chrome Browser

The steps to launch Google Chrome through the GUI are as follows:

  1. Initiate Activities: Depending on your Linux distribution, this could be as simple as hitting the Super (Windows) key or clicking the Activities option, usually found at the top-left corner of your screen.
  2. Access Applications: Once you’ve initiated the activities overview, proceed to view all your installed applications by clicking on the grid icon labeled Show Applications at the bottom of the screen.
  3. Launch Google Chrome: You should now see an overview of all your applications. Look for the Google Chrome icon and click it to launch the browser. If you’ve installed multiple versions (stable, beta, or unstable), each one will be separately listed, e.g., Google Chrome (Stable), Google Chrome (Beta), or Google Chrome (Unstable). Click on the desired version to launch it.

Additional Google Chrome Commands

Understanding how to properly manage Google Chrome on Rocky Linux involves a few essential tasks – keeping the browser updated, removing it if necessary, and learning how to disable or enable the repository for future installations.

Update Google Chrome

While Google Chrome typically notifies users of available updates if installed through the DNF package manager, manually checking for updates is still a good practice.

In your terminal, run the following command:

sudo dnf upgrade --refresh

Executing the command above, you’re prompting your system to check for and apply any available updates.

For those who have installed Google Chrome using Flatpak, the following command will refresh all packages installed by Flatpak, including Google Chrome:

sudo flatpak update

Remove Google Chrome

For users who decide they no longer require Google Chrome, it can be uninstalled easily. The command you’ll need to use will depend on the version of Google Chrome you have installed (stable, beta, or unstable).

DNF Google Chrome Remove Commands

Here’s how you can remove Google Chrome Stable:

sudo dnf remove google-chrome-stable

If you’ve installed either the beta or unstable versions of Google Chrome, use the corresponding commands:

sudo dnf remove google-chrome-beta
sudo dnf remove google-chrome-unstable
Disabling and Enabling Google Chrome Repositories

If you’re not actively using Google Chrome, it might be beneficial to temporarily disable the repositories. This prevents your system from checking for Google Chrome updates during system updates, thus saving resources.

You can disable all Google Chrome repositories with the following command:

sudo dnf config-manager --set-disabled google-chrome*

This command will collectively disable all Google Chrome repositories. However, to disable a specific one, you must first identify its full name. You can do this by listing your imported repositories:

dnf repolist | grep chrome

Once you’ve identified the full name of the repository you want to disable, you can replace google-chrome* with it in the command. For instance, to disable the beta repository only, use:

sudo dnf config-manager --set-disabled google-chrome-beta

If you decide later on that you’d like to install Google Chrome again, you can easily re-enable the repositories. Here’s the command to enable all Google Chrome repositories:

sudo dnf config-manager --set-enabled google-chrome*

Again, to enable a specific repository, replace google-chrome* with the full name of the repository you wish to enable.

Flatpak Google Chrome Remove Commands

For those who installed Google Chrome using Flatpak, the removal process is a bit different:

flatpak uninstall com.google.Chrome

For those who installed the unstable version:

flatpak uninstall com.google.ChromeDev

Final Thoughts

By successfully installing Google Chrome on your Rocky Linux system, you unlock a browsing experience of speed, security, and versatility. Whether opting for the official RPM packages or the Flatpak method, both avenues provide reliable access to Chrome’s rich features. Ensure regular updates to benefit from the latest advancements and security patches, keeping your browsing activities on Rocky Linux both efficient and protected.

Leave a Comment