How to Install and Upgrade Google Chrome Browser on Ubuntu Server via Terminal

Google Chrome is one of the most popular web browsers, and you may want to install or upgrade it on your Ubuntu Server. However, since Ubuntu Server doesn’t have a graphical user interface (GUI), you’ll need to install Chrome via the command line. This guide will walk you through the process of installing Google Chrome and keeping it up to date on your Ubuntu Server.

Prerequisites

Before you begin, ensure that you have the following:

  1. An Ubuntu Server: You should have a running Ubuntu Server with terminal access.

  2. Sudo Privileges: You should have sudo privileges or be logged in as the root user.

Step 1: Update Package Lists

It’s a good practice to start by updating the package lists to ensure you have the latest information about available packages. Open your terminal and run:

1
sudo apt update

Step 2: Install Dependencies

Google Chrome requires some dependencies to be installed on your system. You can install these dependencies by running:

1
sudo apt install wget curl unzip -y

Step 3: Download Google Chrome

Now, you’ll need to download the Google Chrome package for Ubuntu. You can use the wget command to do this. Replace the URL below with the appropriate one for your architecture (32-bit or 64-bit):

For 64-bit systems:

1
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

For 32-bit systems (note that 32-bit Chrome is deprecated by Google and may not be available in the future):

1
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb

Step 4: Install Google Chrome

After downloading the package, you can install Google Chrome using the dpkg command:

1
sudo dpkg -i google-chrome-stable_current_*.deb

If you encounter any dependency issues, you can run:

1
sudo apt install -f

This command will automatically install any missing dependencies.

Step 5: Verify Installation

To verify that Google Chrome is installed, simply run:

1
google-chrome --version

This should display the installed Chrome version.

Step 6: Upgrade Google Chrome (Optional)

To upgrade Google Chrome to the latest version, you can use the following commands:

1
2
sudo apt update
sudo apt upgrade google-chrome-stable

Step 7: Start Google Chrome

Since you’re using a headless server, you can use Google Chrome in headless mode for tasks such as web scraping or automated testing. You can launch Google Chrome in headless mode with the following command:

1
google-chrome --headless --disable-gpu --no-sandbox https://example.com

Replace https://example.com with the URL you want to open in headless mode.

That’s it! You’ve successfully installed and optionally upgraded Google Chrome on your Ubuntu Server via the terminal.

Remember to keep Chrome up to date regularly to benefit from security updates and new features. You can automate this process with a cron job if needed.

0%