Install
and Run Chrome as root in Ubuntu Linux
This tutorial explains how to install the
Google Chrome in Ubuntu Linux and once the Chrome is installed, how to run it
under the root user account.
Google Chrome is one of the most popular
web browsers. Just like the other applications, we cannot install it from the
Ubuntu Software Center. We have to download and install it manually. Before we
learn how to do this, let’s quickly understand why is the Chrome not available
in Ubuntu Software Center?
Chrome is developed by the Google. Google
does not allow third parties to distribute it. Besides this, to download and
use the Chrome, a user has to agree with the Google's restrictive "End
User License Agreement" (EULA). Google's restrictive license does not
allow Ubuntu to distribute the Chrome from its official repositories.
Installing Google Chrome in Ubuntu Linux
Since Chrome is not available in Ubuntu’s
official repositories, it cannot be installed from the Ubuntu Software Center.
We have to manually download and install it. There are two ways to do this;
through the CLI prompt and through the GUI interface. Let’s understand both
methods in detail with examples.
Installing Chrome from the CLI prompt
To install Chrome from the command line,
connect the system with the Internet and run the following command.
$wget
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
This command downloads the latest stable
version of Chrome in the current directory.
Once installer package file is downloaded,
run the following command.
$sudo dpkg -i
google-chrome-stable_current_amd64.deb
This command installs the Chrome from the
downloaded installer package file.
Installing
Google Chrome from GUI Interface
Advertisements
To install the Google Chrome from GUI
interface, download the latest stable version from its official site.
Once downloading is finished, open the
folder which contains the downloaded file.
Select the downloaded file, and do right
click. From right click context menu, click the option "Open With Software Install".
This opens the downloaded file in the installation
wizard of Ubuntu Software center. To start the installation, click the Install button.
To authenticate the installation, type the
super user password.
Upon successful authentication, wizard
starts the installation. Usually, installation takes less than a minute.
Starting Google Chrome
Once Chrome is installed, it can be started
from both methods; command line and GUI interface. To start it from the command
line, use the following command.
$google-chrome
Following two options will be displayed if
Chrome is started for the first time.
·
Make Google Chrome the default browser
·
Automatically send usage statistics and
crash reports to Google
By default, both options are selected. If
you don’t want to set the Google Chrome as the default browser, unselect the
first option. Same way if you don’t want to send the crash reports and usage
statistics to Google, unselect the second option.
After making your decision, click the OK
button to start the Chrome.
Just like the command prompt, we can also
start the Chrome from the GUI interface. To start it from GUI interface, click
the Dash button.
In search box of the opened window, search the keyword "Chrome".
From search result, click the Chrome.
This will launch the Google Chrome.
Running Chrome as root
To enhance the system security, by default,
Chrome does not start under the root user account. Following error is displayed
when Chrome is started under the root account.
ERROR:zygote_host_impl_linux.cc(89)
Running as root without --no-sandbox is not supported. See
https://crbug.com/638180.
To run Chrome as root, open the file /opt/google/chrome/google-chrome for editing.
Append the following configuration values
in the last line of the file.
--user-data-dir --test-type
--no-sandbox
After editing, last line should look like
the following line.
exec -a "$0"
"$HERE/chrome" "$@"--user-data-dir --test-type --no-sandbox
Make sure you add all three options of
configuration values. Skipping second option (--test-type) will through the
following error message when the Chrome will run.
You are using an unsupported command-line
flag: --no-sandbox. Stability and security will be suffered.
To run Chrome as root without any error messages,
add all three options as explained above and save the file.
Once the configuration file is updated with
these options, you can run the Chrome as root.
Removing Chrome from CLI prompt
To uninstall Chrome from the command
prompt, run the following commands.
$sudo dpkg -l |grep google
$sudo dpkg -P google-chrome-stable
First command prints the package name of
Chrome.
Second command removes the package of
Chrome.
Uninstalling
Chrome from GUI interface
To uninstall Chrome from the GUI interface,
open the Ubuntu Software center. In search box of Software center, search the
keyword Chrome. From search result, click the Google Chrome.
On detailed information screen, click
the Remove button.
Click the Remove button again to
confirm the removal of Chrome.
In few seconds, Chrome will be removed from
the system.
That’s all for this tutorial. If you like
this tutorial, please don’t forget to share it through your favorite social
channel.
沒有留言:
張貼留言