如何在Ubuntu上安装Google Chrome?
google-chrome-stable
可以在第三方软件仓库上找到:Google Chrome(稳定版)。
现在 apt-key add
已经被弃用,请使用以下方法:
apt-key add
进行安装:前往https://www.google.com/intl/zh-CN/chrome/browser/
点击下载,将弹出一个带有下载选项的小窗口。
我们需要Ubuntu的“.deb”文件。请确保勾选此框。cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get -f install
google-chrome
命令,或者按下超级键并搜索Google
或Chrome
。https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
。 - Taeram[20264:20264:0201/211304.449159:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
- sreeGoogle Chrome和Chromium是不同的。
Google Chrome和Chromium有什么区别?各自的优缺点是什么?
在Ubuntu软件中心可以找到Chromium。但要下载Google Chrome:
点击下载 Chrome
选择 32 位 .deb
(适用于 32 位 Ubuntu)或 64 位 .deb
(适用于
64 位 Ubuntu)
点击接受并安装
将.deb文件下载到一个文件夹中(默认文件夹是下载)
打开下载文件夹。
双击刚刚下载的.deb文件。
这应该会启动Ubuntu Software Centre。
当提示是否要安装Chrome时,只需选择是。
packages have unmet dependencies
或者
package <package-name> is not installed
sudo apt-get -f install
sudo dpkg -i <google-chrome>.deb
if [[ $(getconf LONG_BIT) = "64" ]]
then
echo "64bit Detected" &&
echo "Installing Google Chrome" &&
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb &&
sudo dpkg -i google-chrome-stable_current_amd64.deb &&
rm -f google-chrome-stable_current_amd64.deb
else
echo "32bit Detected" &&
echo "Installing Google Chrome" &&
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb &&
sudo dpkg -i google-chrome-stable_current_i386.deb &&
rm -f google-chrome-stable_current_i386.deb
fi
:~$ sudo apt-get install build-essential -y
//************************************************************************
// This googGt.cpp is created to install the google-chrome web browser
// on Ubuntu 14.04 lts 64 bit.
// author@GWade
//************************************************************************
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <locale>
using namespace std;
void PrntGoogPpa(ofstream& googPpa);
void PrntGoogGtr(ofstream& googGtr);
void PrntGoogLst(ofstream& gogLst);
int main()
{
cout << "Creating the script that adds google-chrome PPA\n" <<endl;
// create the googPpa.sh shell script
ofstream googPpa;
googPpa.open("googPpa.sh");
PrntGoogPpa(googPpa);
googPpa.close();
cout << "Changing the mode of access to executable on the script\n" << endl;
// change mode of access to executable
system("chmod +x googPpa.sh");
cout << "Excuting and installing the Google-Chrome Web Browser\n" << endl;
system("./googPpa.sh");
// create an ofstream object and call the function
cout << "Creating the script that installs google-chrome\n" << endl;
ofstream googGtr;
googGtr.open("googGt.sh");
PrntGoogGtr(googGtr);
googGtr.close();
cout << "The googGt.sh script has been created\n" << endl;
cout << "Changing the mode of access to executable on the script\n" << endl;
system("chmod +x googGt.sh");
cout << "Excuting and installing the Google-Chrome Web Browser\n" << endl;
system("./googGt.sh");
system("rm -rf /etc/apt/sources.list.d/google-chrome.list");
ofstream googLst;
googLst.open("/etc/apt/sources.list.d/google-chrome.list");
PrntGoogLst(googLst);
googLst.close();
}
void PrntGoogPpa(ofstream& googPpa)
{
googPpa << "#! /bin/bash\n\nUPD=\"updatedb\"\n" << endl;
googPpa << "wget -q -O - "
<< "https://dl-ssl.google.com/linux/linux_signing_key.pub"
<< " | sudo apt-key add -" << "\n" << endl;
googPpa << "echo \"deb http://dl.google.com/linux/chrome/deb/ stable main\""
<< " >> /etc/apt/sources.list.d/google.list\n\n$UPD\n\nexit" << endl;
}
void PrntGoogGtr(ofstream& googGtr)
{
googGtr << "#! /bin/bash\n\nAPGTN=\"apt-get install\"" << endl;
googGtr << "APUPD=\"apt-get update\"\nUPD=\"updatedb\"\n" << endl;
googGtr << "$APUPD\n\n$APGTN google-chrome-stable -y\n" << endl;
googGtr << "$UPD\n\nexit" << endl;
}
void PrntGoogLst(ofstream& googLst)
{
googLst << "### THIS FILE IS AUTOMATICALLY CONFIGURED ###" << endl;
googLst << "# You may comment out this entry, but any other modifications"
<< " may be lost." <<endl;
googLst << "# deb http://dl.google.com/linux/chrome/deb/ stable main" <<endl;
}
:~$ g++ googGt.cpp
:~$ sudo bash
:~# ./a.out
sudo apt-get install chromium
命令。我认为这样更容易安装!另请参阅:Chrome和Chromium之间有什么区别? - rugksudo apt-get install chromium-browser
- cdosbornsudo snap install chromium
安装Chromium。 - arshbot