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:
-
An Ubuntu Server: You should have a running Ubuntu Server with terminal access.
-
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:
|
|
Step 2: Install Dependencies
Google Chrome requires some dependencies to be installed on your system. You can install these dependencies by running:
|
|
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:
|
|
For 32-bit systems (note that 32-bit Chrome is deprecated by Google and may not be available in the future):
|
|
Step 4: Install Google Chrome
After downloading the package, you can install Google Chrome using the dpkg
command:
|
|
If you encounter any dependency issues, you can run:
|
|
This command will automatically install any missing dependencies.
Step 5: Verify Installation
To verify that Google Chrome is installed, simply run:
|
|
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:
|
|
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:
|
|
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.