User Agents

Web browsers and everyday web tech, explained

Fix Google Chrome Failing to Run on CentOS

· 5 min read · Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To fix Google Chrome failing to run on CentOS, you must typically address missing dependency libraries, resolve sandbox permission conflicts, or ensure the browser is not being blocked by SELinux policies. Because CentOS is often used in server environments, it frequently lacks the graphical libraries and user-session configurations required for a desktop browser to launch. Following these steps will ensure all required packages are installed and the environment is configured to allow the Chrome binary to execute.

What You'll Need

  • A user account with sudo or root privileges.
  • An active internet connection to download missing dependencies.
  • A terminal emulator (such as GNOME Terminal or Putty if accessing via SSH).
  • Google Chrome installed via the official .rpm package.

Step-by-Step

  1. Identify the Exact Error: Open your terminal and attempt to launch Chrome from the command line by typing google-chrome. If the browser fails to start, the terminal will output specific error messages. Look for phrases like "error while loading shared libraries" or "cannot open display." These logs are critical for determining whether the issue is a missing library or a permission error.
  2. Install Missing Dependencies: Chrome requires several X11 and system libraries that may not be present in a minimal CentOS installation. Use the YUM or DNF package manager to install common missing dependencies. Run the following command: sudo yum install libX11 libXcomposite libXcursor libXdamage libXext libXfixes libXi libXrender libXtst cups-libs dbus-glib alsa-lib pango atk at-spi2-atk.
  3. Check for Missing Shared Libraries: If Chrome still fails, use the ldd command to check for unresolved dependencies. Run ldd /opt/google/chrome/chrome | grep "not found". If any libraries are listed as "not found," search for the package providing that library using yum provides [library-name] and install the resulting package.
  4. Resolve Sandbox Issues: On some CentOS configurations, the Chrome sandbox cannot initialize due to kernel restrictions or namespace limitations. To test if this is the cause, launch Chrome with the sandbox disabled: google-chrome --no-sandbox. If the browser opens, you have a sandbox permission issue. Note: Running without a sandbox is a security risk and should only be used for diagnosis or in isolated environments.
  5. Configure SELinux: Security-Enhanced Linux (SELinux) can block Chrome from executing certain memory operations. Check if SELinux is causing the failure by temporarily setting it to permissive mode: sudo setenforce 0. Try launching Chrome again. If it works, you may need to update your SELinux policies or keep it in permissive mode if the environment is secure.
  6. Fix Display Environment Variables: If you are running CentOS in a virtual machine or via remote desktop and see a "cannot open display" error, ensure the DISPLAY variable is set correctly. Use export DISPLAY=:0 (or the appropriate display number for your session) before launching the browser.
  7. Clear the User Profile: A corrupted user profile can prevent Chrome from launching. Navigate to the Chrome config directory: rm -rf ~/.config/google-chrome. This resets the browser to default settings and often clears startup crashes.

Common Mistakes

  • Running as Root without Flags: Attempting to run Google Chrome as the root user will result in an immediate failure. Chrome refuses to run as root for security reasons unless the --no-sandbox flag is explicitly used.
  • Ignoring Terminal Output: Clicking the GUI icon and seeing nothing happen is frustrating. The biggest mistake is not using the terminal to see the actual error log, which tells you exactly which library is missing.
  • Using Outdated Repositories: Attempting to install dependencies from old or third-party repositories that are incompatible with your specific CentOS version (e.g., mixing CentOS 7 and 8 packages).

Tips

  • Use Chromium: If Google Chrome continues to be unstable, try installing Chromium via the EPEL repository. It is the open-source base for Chrome and often has better integration with CentOS package managers.
  • Update the System: Always run sudo yum update before installing Chrome to ensure your kernel and glibc versions are current, as Chrome requires modern system libraries.
  • Check Disk Space: Ensure the /tmp directory and your home partition have sufficient space, as Chrome creates large temporary files during startup.

Troubleshooting

If Chrome still fails to run after following the steps above, check the following scenarios:

  • GPU Acceleration Crashes: If Chrome starts but shows a black screen or crashes immediately, try disabling hardware acceleration: google-chrome --disable-gpu. This is common in virtualized environments (VMware/VirtualBox).
  • Zombie Processes: Sometimes a crashed instance of Chrome leaves behind "zombie" processes that prevent new instances from starting. Run pgrep chrome to see if any are running, and use killall chrome to clear them.
  • Library Version Mismatch: If ldd shows a library is present but you still get a "version GLIBC_X.X not found" error, your version of CentOS is likely too old for the current version of Chrome. You will need to upgrade your OS version.

Frequently Asked Questions

Why does Chrome say it cannot be run as root?

Chrome uses a multi-process architecture with a sandbox to prevent malicious websites from accessing your system. Running as root bypasses these security boundaries, which Chrome prevents by default to protect the OS.

Will the --no-sandbox flag make my browser unsafe?

Yes. The sandbox is a primary security layer. Disabling it allows a compromised renderer process to potentially execute code with the privileges of the user running the browser.

What is the difference between Chrome and Chromium on CentOS?

Chromium is the open-source project that Google Chrome is built upon. Chromium is often available in the EPEL repository for CentOS, making it easier to install and manage than the proprietary Google Chrome .rpm.

How do I know if SELinux is the problem?

You can check the audit logs by running sudo ausearch -m avc -ts recent. If you see "denied" messages related to the Chrome binary, SELinux is blocking the execution.

Can I run Chrome on a CentOS server without a GUI?

Yes, but you must run it in "headless" mode. Use the command google-chrome --headless --disable-gpu. This is typically used for automated testing or web scraping.