Run chrome in linux

How to Install Chrome Browser on Ubuntu Linux

In this guide, I’m going to show you how to Install the latest Chrome and run it from Terminal on Ubuntu Linux. If you are open source fan, use Chromium which is the open source version of proprietary Google Chrome browser. Few differences exist between Chome and Chromium web browsers. The Google Update daemon which automatically updates Chrome to the latest version is not available for Chromium. Also, Chrome adds non-free codes like AAC, MP3, and H.264. These codecs are not available on Chromium. Chromium only includes limited support for HTML5 audio/video codec to what is available as non-proprietary codecs like WebM, Theora, VP9, etc.

We are going to install, run, update and uninstall Chrome using the terminal on Ubuntu 18.04, CentOS 7 and Arch Linux.

Install and Update Google Chrome on Ubuntu 18.04

a) Using Google repositories

For the terminal centric users, you can easily install latest Google Chrome browser using the official Google repositories. For doing this, create file named «google-chrome.list» in the «/etc/apt/sources.list.d» directory.

But first, you need to add the repository and install apt-key, use the commands:

Type in terminal the following command

and add the following content into that file

or
use below one-liner

After adding Google repository to your sources, you need to get repository key with the following command

Update your sources by running the following command

If all steps mentioned above are done, you can install Google Chrome using apt command.

Note that you can also install beta and unstable versions of Chrome using the same repository. To do that use the following commands.

For unstable version of Chrome

Now you can run Chrome from terminal by running the following command

This will run Google Chrome in background.

If you have already installed Google Chrome via apt and you want to upgrade to the latest version you can type the latest version install command in your terminal:

or update your system by the following command

b) Manually download Debian package

The easiest and most user-friendly way to install Chrome on Ubuntu is to download the .deb package from the official website and install it using the dpkg package manager for Debian based systems. Download Chrome installer from the link. Once you download the package, install it using

After this steps you can run Google Chrome via terminal by the command below:

to run Chrome in background.

The installation process will add a PPA to your system so Google Chrome will receive the latest updates whenever you update your system.

To remove Google Chrome from your system type the command below:

Install Flash Player on Ubuntu

The flashplugin-installer package provides the NPAPI plug-in for Firefox and Chromium. To install Adobe Flash Plugin, you need to enable Canonical Partner repository which offers some proprietary applications that don’t cost any money to use but are closed source.

Install Chromium on Ubuntu

Since Chromium is an opensource version of Chrome, its packages are distributed through official Ubuntu upstream repositories. You just need to update your apt cache index and install it. Use the commands:

If you need Pepper Flash Player — browser plugin

Chromium browser can easily be upgraded by running the commands:

Читайте также:  Изменить скорость указателя мыши windows 10

Install and Update Google Chrome on CentOS 7

To get the latest version of Chrome on your CentOS you need to add Google yum repository to your repos. To do this create file named google-chrome.repo in the /etc/yum.repos.d/ directory. Type in terminal the following command

Add the following lines into the file and save

After repository is enabled in your CentOS 7, you can type the following command to see information about latest stable version of Google Chrome

Output of the command will look like this

Record the Version of the latest Google Chrome and proceed to its installation using the following command

This will install the latest stable Google Chrome. Just make sure the outputted version during the installation is the same as the one we saw in info above.

Once the installation process is finished you can open Google Chrome by typing the following command in terminal

This will run the browser in background.

To upgrade already installed Google Chrome to the latest version, just type the install command in your terminal:

Install and Update Google Chrome on ArchLinux

In ArchLinux the installation process of Google Chrome differs from CentOS and Ubuntu. You need to install the google-chrome package from AUR (Arch User Repository). To do this we need to find snapshot download URL of google-chrome package on AUR website. On the website, search for the desired package and find «Download snapshot». Copy link address by right clicking on the link. Then, using wget command, download the snapshot to your ArchLinux machine. For Google Chrome the command looks like this:

Uncompress the downloaded tar.gz file using the following command:

and change the working directory to newly created one:

Use the following command to compile the package:

After compile, you will have file with .xz extension in your directory. Type ls to view the content of the directory.

Now you can install Google Chrome with the following command:

To run Google Chrome on ArchLinux from terminal you must type:

To remove Chrome from ArchLinux, run the following command in the terminal:

Источник

Launch a Chrome app from command line

I can’t find how to launch a chrome app from a bash ?

I’m trying to achieve this with Postman.

From google-chrome -h , I tried (unfortunately) those ones :

The result is that a new blank window is opened.

My first guess is the app is stored on my machine and I need to open a specific file (the app index) to launch it.

Is it possible to achieve this ?

And if it’s possible, how to do ?

/.local/share/applications (drag it over an opened gedit window) you can see the correct command in the Exec= line.

5 Answers 5

Answered thanks to @JacobVlijm .

To run a chrome app from command-line, use the following :

Assuming the path of google-chrome is /opt/google/chrome/google-chrome .

To retrieve the app id, search the first occurrence of the application name in /home/$USER/.local/share/applications .

Unfortunately, no there is no way provided to call an app at the command line by it’s name. Providing this feature would mean unreliable extra parsing for installed apps and some would consider it a security flaw. You can do the parsing yourself, however, with a script that searches and extracts the name of each extension/app until it finds the name you search for:

Some apps set their names deeper in the scripts — I don’t know why! You may have to re-write or add to a script like this one to search «.desktop» files in

/.local/share/applications for their ‘^NAME=. ‘ equivalent to the above, and then get the execution command there.

I have not tested this script — I just wrote it on the fly to answer your question. I hope that as an example it works for you, but if the idea is not quite right, we could tweak it a bit. Zsh is simple, strait-forward syntax compared to some other sh-compatible shells. I have tried to leave out any features that require new versions or modules except for PCRE. PCRE is so much easier to use for the exact pattern matching I often need that I neglect regular Regex most of the time. A longer Perl script could work, also most of this syntax will run unmodified in /bin/bash . foreach . end , $match[1] style arrays, setopt rematchpcre , the exact systax of Bash Regex, and emulate are the main exceptions.

Читайте также:  Ms teams linux background

Источник

How to run google chrome as root in linux

when I want to run google chrome as root, an error message with this title appears:

Google chrome can not be run as root

and the body of message is:

to run as root, you must specify an alternate —user-data-dir for storage of profile information.

can anyone help me?

8 Answers 8

To run google chrome as root, follow these steps:

Open google-chrome in your favorite editor (replacing $EDITOR with your favorite):

Add —user-data-dir at the very end of the file.

my file looks like this:

Save and close the editor.

you’re done. Enjoy it 🙂

if you want to see video tutorial, you can check my blog post:

Now you cannot run google-chrome as root user on updated versions, To run Google Chrome as standard user (while Logged in as Root)

open terminal and type:

adduser -u chromeuser OR useradd -m chromeuser

To run google chrome use command:

gksu -u chromeuser google-chrome OR sux chromeuser google-chrome

If you don’t want to run it from Terminal then add chrome in taskbar and then right-click on it, select properties and add the above command in the command parameter.

For those who may be still googling at Dec 2016 — Google Chrome Version 54.0.2840.90 64bit under XFCE and Debian 8.5:

Case 1: Chrome not starting at all
In my setup just by running in terminal google-chrome-stable i was getting immediately an error in terminal illegal instruction . No frames, no screen blanking , no black windows. Just a rude console error. This error goes away by using the —no-sandbox command line option.

Case 2: Chrome still refuses to open even with —no-sandbox option
That was not my case since —no-sandbox was enough, but if you experience such behavior you could try to disable everything when calling chrome, like:

Then you can step by step enable options till to identify which one breaks.
PS: All CLI flags/args can be found here.

Case 3: Message Please start Google Chrome as a normal user.To run as root you must specify an alternate —user-data-dir for storage of profile information appears.

Solution that worked for me : Go to /opt/google/chrome and open file google-chrome which is actually a bash script.

At the end of the script find the part

And change the else part like this:

Save, and run google-chrome-stable —no-sandbox .
I got up and surfing.

For a more sophisticated solution i personally applied a kind of user check to avoid possible disturbance running chrome as normal user :

Another Workaround:
You can not modify the google-chrome file as indicated above, and you can either follow recomendation of @tzafar for creating a new user or to launch chrome using an existing normal user account : gksu -u user google-chrome-stable (this worked but some error messages received in terminal).

Источник

Установка Google Chrome в Linux

Одним из самых популярных браузеров в мире считается Google Chrome. Далеко не все пользователи довольны его работой из-за большого потребления системных ресурсов и не для всех удобной системой управления вкладками. Однако сегодня мы бы не хотели обсуждать достоинства и недостатки этого веб-обозревателя, а поговорим о процедуре его инсталляции в операционные системы на базе ядра Linux. Как известно, выполнение этой задачи значительно отличается от той же платформы Windows, поэтому и требует детального рассмотрения.

Устанавливаем Google Chrome в Linux

Далее мы предлагаем ознакомиться с двумя различными методами установки рассматриваемого браузера. Каждый будет наиболее подходящим в определенной ситуации, поскольку у вас имеется возможность выбрать сборку и версию самостоятельно, а потом уже добавлять все компоненты в саму ОС. Практически на всех дистрибутивах Линукс этот процесс осуществляется одинаково, разве что в одном из способов придется выбрать совместимый формат пакета, из-за чего мы предлагаем вам руководство, основанное на последней версии Ubuntu.

Читайте также:  Windows 10 все сливает

Способ 1: Установка пакета с официального сайта

На официальном сайте Google для скачивания доступны специальные версии браузера, написанные под дистрибутивы Linux. Вам нужно только загрузить пакет на компьютер и провести дальнейшую инсталляцию. Пошагово эта задача выглядит так:

    Перейдите по указанной выше ссылке на страницу загрузки Google Chrome и нажмите на кнопку «Скачать Chrome».

Выберите формат пакета для загрузки. В скобках указаны подходящие версии операционных систем, поэтому с этим сложностей возникнуть не должно. После этого щелкните на «Принять условия и установить».

Теперь вы можете запустить скачанный DEB или RPM-пакет через стандартное средство ОС и кликнуть на кнопку «Установить». По завершении инсталляции запускайте браузер и приступайте к работе с ним.

Детально ознакомиться с методами установки DEB или RPM-пакетов вы можете в других наших статьях, перейдя по указанным ниже ссылкам.

Подробнее: Установка RPM-пакетов / DEB-пакетов в Ubuntu

Способ 2: Терминал

Не всегда у пользователя имеется доступ к браузеру или получается найти подходящий пакет. В таком случае на помощь приходит стандартная консоль, через которую можно загрузить и установить любое приложение на свой дистрибутив, включая рассматриваемый веб-обозреватель.

    Для начала запустите «Терминал» любым удобным образом.

Загрузите пакет нужного формата из официального сайта, задействовав команду sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb , где .deb, может меняться на .rpm , соответственно.

Введите пароль от своей учетной записи для активации прав суперпользователя. Символы при наборе никогда не отображаются, обязательно учитывайте это.

Ожидайте завершения загрузки всех необходимых файлов.

Установите пакет в систему с помощью команды sudo dpkg -i —force-depends google-chrome-stable_current_amd64.deb .

Вы могли заметить, что в ссылке содержится только приставка amd64, а это значит, что скачиваемые версии совместимы только с 64-разрядными операционными системами. Такая ситуация сложилась из-за того, что Google перестали выпускать 32-битные версии после сборки 48.0.2564. Если вы хотите получить именно ее, нужно будет проводить немного другие действия:

    Потребуется загрузить все файлы из пользовательского репозитория, а делается это через команду wget http://bbgentoo.ilb.ru/distfiles/google-chrome-stable_48.0.2564.116-1_i386.deb .

При получении ошибки о неудовлетворении зависимостей пропишите команду sudo apt-get install -f и все будет работать нормально.

Альтернативный вариант — вручную проставьте зависимости через sudo apt-get install libxss1 libgconf2-4 libappindicator1 libindicator7 .

После этого подтвердите добавление новых файлов, выбрав соответствующий вариант ответа.

Запускается браузер с помощью команды google-chrome .

Откроется стартовая страница, с которой начинается взаимодействие с веб-обозревателем.

Инсталляция разных версий Chrome

Отдельно бы хотелось выделить возможность установки разных версий Google Chrome рядом или выбора стабильной, бета или сборки для разработчика. Все действия все так же выполняются через «Терминал».

    Загрузите специальные ключи для библиотек, введя wget -q -O — https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add — .

Далее скачайте необходимые файлы с официального сайта — sudo sh -c ‘echo «deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main» >> /etc/apt/sources.list.d/google-chrome.list’ .

Обновите системные библиотеки — sudo apt-get update .

Запустите процесс установки необходимой версии — sudo apt-get install google-chrome-stable , где google-chrome-stable может быть заменено на google-chrome-beta или google-chrome-unstable .

В Гугл Хром уже встроена свежая версия Adobe Flash Player, но не у всех пользователей Linux она работает корректно. Мы предлагаем вам ознакомиться с другой статьей на нашем сайте, где вы найдете детальное руководство по добавлению плагина в саму систему и браузер.

Как видите, приведенные выше способы разные и позволяют выполнить установку Google Chrome в Linux, основываясь на своих предпочтениях и возможностях дистрибутива. Мы настоятельно советуем ознакомиться с каждым вариантом, а потом уже выбрать наиболее подходящий для себя и следовать инструкциям.

Помимо этой статьи, на сайте еще 12315 инструкций.
Добавьте сайт Lumpics.ru в закладки (CTRL+D) и мы точно еще пригодимся вам.

Отблагодарите автора, поделитесь статьей в социальных сетях.

Источник

Оцените статью