无法安装Google Chrome和libappindicator1

我最近在我的计算机上安装了Ubuntu 16.04,我尝试安装谷歌浏览器,但我无法做到。 这就是我得到的。

$ sudo dpkg -i ~/Downloads/google_chrome.deb (Reading database ... 207470 files and directories currently installed.) Preparing to unpack .../Downloads/google_chrome.deb ... Unpacking google-chrome-stable (55.0.2883.87-1) over (55.0.2883.87-1) ... dpkg: dependency problems prevent configuration of google-chrome-stable: google-chrome-stable depends on libappindicator1; however: Package libappindicator1 is not installed. dpkg: error processing package google-chrome-stable (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.7.5-1) ... Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5) ... Processing triggers for mime-support (3.59ubuntu1) ... Errors were encountered while processing: google-chrome-stable 

所以我尝试安装libappindicator1,这就是我得到的

 $ sudo apt-get install libappindicator1 E: Type '@deb' is not known on line 1 in source list /etc/apt/sources.list.d/google.list E: The list of sources could not be read. E: Type '@deb' is not known on line 1 in source list /etc/apt/sources.list.d/google.list E: The list of sources could not be read. 

我是Linux新手,所以我不知道这意味着什么,以及如何解决它。 帮助将不胜感激。

google-chrome-stable可在第三方存储库中使用:Google Chrome(适用于稳定版)。

按照安装说明进行操作:

  1. 添加密钥:

     wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
  2. 设置存储库:

     sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' 
  3. 安装包:

     sudo apt-get update sudo apt-get install google-chrome-stable 

或者使用.deb文件

1.转到https://www.google.com/intl/zh-CN/chrome/browser/

2.单击“下载”,将弹出一个小窗口,其中包含一些下载选项。

  • 为Ubuntu选择.deb文件。

3.使用Ubuntu软件中心打开后会自动安装

1.我从官方网页下载了.deb文件。

后来我输入了你已写的命令:

 sudo dpkg -i google-chrome-stable_current_amd64.deb 

(我有64位架构,这就是我下载amd64的原因)

然后我下载了丢失的文件

 sudo apt-get install libappindicator1 

然后我得到一个错误,libappindicator7 …而且APT建议我运行命令:

 apt-get -f install 

没有争论。

接下来,它询问您是否要同时安装libappindicator1libappindicator7 。 你键入y

4.最后你再次执行第一个命令……

 sudo dpkg -i google-chrome-stable_current_amd64.deb 

然后它的作品!

注意:我没有告诉你先用libappindicator运行这些命令..因为你可能会收到另一个关于“丢失文件”的错误,所以第一个dpkg -i google-chrome-stable_current_amd64.deb会告诉你你需要什么。

从它的角度来看,这只是/etc/apt/sources.list.d/google.list中的一个错字( @已经潜入了一行的开头)。 它可能仍然存在,但有时总是抛出相同的错误并不是非常一致。

为了解释你提到的其他内容,如果存在所有依赖项, dpkg -i会安装一个包,但它不会为你安装依赖项。 相反, apt工具倾向于管理整个过程。

获得自动安全更新,这是通常最好将repo添加到源列表并自动使用apt从中进行安装的两个原因。 (虽然当你这样做时,你相信回购所有者永远不会在他们的回购中包含恶意软件,或者让那些做过的人接管它)。

我在Debian Stretch上遇到了这个问题,这是因为我在/etc/apt/sources.list中有一个未经validation的cdrom存储库。 解决方案是评论它。

帮助我的答案是: https : //askubuntu.com/a/803509

运行此命令为我解决了依赖性问题:

 sudo apt-get install libappindicator3-1 libindicator3-7 

Chrome版本:67.0.3396.87(官方版)(64位)。 这是最新的 – 2018年6月24日。

看起来这两个包之间存在循环依赖关系,需要通过单个apt-get命令进行安装。

访问https://www.ubuntuupdates.org/package_metas/alphabetical

搜索所需的包,单击链接,选择所需的版本。 单击“APT INSTALL”按钮可以直接安装所需的软件包。 您不必下载它们。

然后,如果您已经下载了该软件包,则可以在终端中运行sudo dpkg -i google-chrome-42-0-2311-90-64-bit-multi-ubu.deb

我也面临同样的问题,但后来逐个安装了所需的软件包,最后安装了google-chrome。 它安装没有任何错误。