203

I am trying to install chrome browser via command line. I tried this:

$ apt-cache search chrome browser

The results show that the proper term is "chrome-browser," so I tried that:

$ sudo apt-get install chrome-browser

And then "Y" for the Y/n question.

But the installation threw errors. Does someone see anything wrong with the commands I issued?

Eric Leschinski
  • 2,221
  • 1
  • 20
  • 24

7 Answers7

286

Google Chrome is not in the repositories because it is proprietary, however Chromium(the open source platform Chrome is built upon) is.

These are the instructions to install Chrome on a 64 bit Linux distribution as that architecture is the only one Chrome supports.

To install Google Chrome, run the following:

sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome*.deb

Installed this way, the package has the name google-chrome-stable.

If error messages pop up after running the command sudo apt install ./google-chrome*.deb then run the command

sudo apt-get install -f
Abdull
  • 502
jrg
  • 60,611
  • 3
    uname -i gave me x86_64 but it would seem I needed it to output amd64 instead. – altendky Aug 21 '13 at 00:07
  • 1
    I get this an ERROR 404 with these instructions. I installed using @David E. Moore instructions listed below. Not sure if adding the libxss1 helped with Mr Moore's instruction or not but I did do that before. This was on a fresh install on 13.10 Unity amd64 install. – lqlarry Oct 19 '13 at 18:28
  • 2
    What is the package libxss1 for? Is this still a requirement? – king_julien Oct 30 '13 at 11:08
  • 1
    I also had to install xdg-utils with sudo apt-get install xdg-utils – Juampy NR Nov 28 '13 at 12:19
  • libcurl3 is also required. – MemphiZ Oct 20 '14 at 19:34
  • This will not update chrome as part of the package manager. It's better to add the repository. – AlikElzin-kilaka Jan 27 '15 at 11:59
  • dpkg: dependency problems prevent configuration of google-chrome-stable: google-chrome-stable depends on libpango1.0-0 (>= 1.22.0); however: Package libpango1.0-0 is not installed. – Nicholas DiPiazza Mar 10 '15 at 06:09
  • @James Could you please update this to indicate that google has ended support for 32 bit as of March 2016 from here – Jeremy31 Apr 26 '16 at 21:17
  • I needed to run the following command to install Chrome 51 on Ubuntu 16: apt-get install libnss3-nssdb fonts-liberation libnspr4 libnss3 libcurl3 – Zafer May 26 '16 at 08:32
  • https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb returns 404 – reggie Jul 09 '16 at 02:41
  • 1
    @reggie done! :) – jrg Jul 09 '16 at 10:58
  • @jeremy31 all taken care of, sorry I missed your comment back in April!! – jrg Jul 09 '16 at 10:58
  • I've found using gdebi-gtk instead of sudo dpkg -i google-chrome*.deb more convenient. Basically one has to run, gksudo gdebi-gtk, followed by opening the deb file from the menu and the selecting Install Package. – nlern Jul 31 '16 at 17:32
  • Hello guys, is this command set relevant for Ubuntu 16.04 updated? –  Mar 04 '17 at 01:06
  • I wish I had enough rep to answer, but there's an easier way. wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb and then sudo apt-get install ./google-chrome-stable_current_amd64.deb - that handles everything including dependencies. – tobii Jul 10 '18 at 19:09
109

As per http://www.ubuntuupdates.org/ppa/google_chrome

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
  • 1
    Finally, this works on ix86 systems, thakns – radtek Nov 21 '14 at 01:38
  • 3
    This is a great answer to get the standard Google Chrome. – Mythul Mar 20 '15 at 20:01
  • 5
    This should be the accepted answer since it also pulls dependencies. – Thomas Wana May 17 '18 at 17:31
  • 1
    after following the steps, when i run the command sudo apt-get install google-chrome-stable, "Unable to locate package google-chrome-stable" – Anurag Srivastava Oct 04 '18 at 03:45
  • Perhaps you are using a 32-bit Ubuntu when only 64-bit is supported now, as suggested by https://askubuntu.com/a/853130/28107. – Dale E. Moore Oct 05 '18 at 14:04
  • After running the commands above in Ubuntu 20.04, when running apt upgrade I get many warnings like this: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1. The error disappears after deleting /etc/apt/sources.list.d/google.list – Marco Lackovic Oct 02 '20 at 05:59
58

If you really want to install Chrome (not Chromium) using apt-get it's possible as explained here:

  • Add google repository to your sources, that is, create a new file under /etc/apt/sources.list.d with the following contents:

    deb http://dl.google.com/linux/chrome/deb/ stable main
    
  • Get repository key:

    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    
  • Update your sources:

    sudo apt-get update 
    
  • And install the package:

    sudo apt-get install google-chrome-stable
    

Note: instead of google-chrome-stable you can also install either google-chrome-beta or google-chrome-unstable packages from the same repository.

Zanna
  • 70,465
jcollado
  • 9,598
  • 1
    You said "create a new file under...", but what should I name that file? –  Nov 14 '11 at 20:47
  • 2
    Well, the problem with this is that when you install Chrome, in theory it'll break, because Chrome's postinstall script does this for you... :) – jrg Nov 14 '11 at 20:53
  • 1
    I'd say that the name of the file isn't really important (not sure about the extension though). I'd name it google.list, but it could be chrome.list or some other random name not being already used. – jcollado Nov 14 '11 at 20:55
  • @jrg I decided to give it a try and what I found is that indeed Chrome packaging scripts add a new file under /etc/apt/sources.list.d. The result of this is that Chrome installation didn't fail, but apt-get update now prints a "duplicate sources.list entry" warning; so, yes, this method shouldn't be used unless you want to fix the sources files later. – jcollado Nov 14 '11 at 21:49
  • 6
    Here are the relevant instructions on the Google PPA page. Some of the details are now a bit different and so the above answer should be updated accordingly. – Chan-Ho Suh May 17 '12 at 23:48
  • One of the answers here creates the file as well. – AlikElzin-kilaka Jan 27 '15 at 11:59
  • non-free should be removed from the PPA file... – billy May 21 '15 at 11:40
  • +1 this is much nicer for managing dependency issues. – gnomed May 22 '16 at 02:59
  • This currently works for me(tm) – oPless Jan 23 '17 at 16:09
24

If you are running a 64 Bit system, then use this:

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

then:

sudo dpkg -i ./google-chrome*.deb

and to finish:

sudo apt-get install -f

This is the same as jrg's reply, but you change the i386.deb to amd64.deb.

EDIT: The past couple of times I have not had to do the install -f. It seems to have all needed after installing.

Good Luck!!

lqlarry
  • 696
  • Jorge added this to the accepted answer above. I guess I should of thought of that. Makes the answer more complete now. – lqlarry Nov 20 '11 at 03:12
  • Is the line sudo apt-get install -f really necessary? – king_julien Oct 30 '13 at 11:27
  • 1
    I think my answer is outdated. I've used the answer above mine (at this time) by @Dale E. Moore and had successful installs. – lqlarry Nov 04 '13 at 03:19
  • Your answer is not outdated. The google-chrome-stable_current_amd64.deb will remain current (by its namesake) as long as it's being maintained and updated by Google. On rare occasions, just like any manual install, you might have to use the install -f option. But as of Ubuntu 18.04, it installs the absolute latest Chrome update and configures it to be automatically flagged for regular updates when they are available. The two commands are the cleanest and easiest method of a fresh install of Google Chrome. – L. D. James Jun 16 '18 at 08:53
9
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update 
sudo apt-get install google-chrome-stable 

that's correct code for ubuntu :)

guntbert
  • 13,134
Kornel
  • 91
  • 1
  • 1
6

If you want the official Google Chrome build, you have to download it from here: Download Google Chrome.

I believe only Chromium is in the repository.

matpie
  • 749
-6

If you want Google Chrome, just search it in google. If you want Chromium add this ppa:

sudo add-apt-repository ppa:chromium-daily/stable
sudo apt-get update
sudo apt-get install chromium-browser

And that's it. Enjoy your browser.

rockr101
  • 1,421
  • 8
    -1, daily builds aren't recommended for anyone other than developers. THIS IS DANGEROUS. – jrg Nov 14 '11 at 20:43
  • 2
    What PPA should be added? If you cannot answer this question now you can delete your answer, and gain back 2 rep. – nanofarad Oct 03 '12 at 20:45