Debian 9 无法安装 Google Chrome

Debian 9 无法安装 Google Chrome

我已经从可启动 USB 闪存驱动器安装了 Debian 9。我只将 1 张 DVD 复制到上面,因为 Debian 网站说我需要的就是这些。我在整个分区上安装了 Debian(我没有将其分解为 /home 或其他任何分区)。我安装了 GNOME 桌面。我没有使用网络安装,因为我的连接很糟糕(我首先必须去学校下载 .iso)。

我的第一次尝试将 chrome 添加到 /etc/apt/sources.list debhttp://dl.google.com/linux/chrome/deb/稳定的主线

然后我跑了

get https://dl-ssl.google.com/linux/linux_signing_key.pub

sudo apt-key add linux_signing_key.pub

sudo apt-get update

sudo apt-get install google-chrome-stable

结果是这样的:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 google-chrome-stable : Depends: gconf-service but it is not installable
                    Depends: libgconf-2-4 (>= 3.2.5) but it is not             installable
                    Depends: libappindicator1 but it is not installable
E: Unable to correct problems, you have held broken packages.

然后我尝试从谷歌本身下载一个解压安装程序。首先我跑了

apt-get clean && apt-get update
apt-get upgrade
apt --fix-broken install

然后我跑了

dpkg -i google-chrome-stable_current_amd64.deb 

从我的下载目录。那个吐出来的

Selecting previously unselected package google-chrome-stable.
(Reading database ... 125174 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (60.0.3112.90-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
 google-chrome-stable depends on gconf-service; however:
Package gconf-service is not installed.
google-chrome-stable depends on libgconf-2-4 (>= 3.2.5); however:
Package libgconf-2-4 is not installed.
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.6.1-2) ...
Processing triggers for gnome-menus (3.13.3-9) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
Errors were encountered while processing:
 google-chrome-stable

我在这里做错了什么?我需要未随 USB 可启动磁盘安装的依赖项,但我无法获取这些依赖项。我尝试在突触包安装程序中搜索这些依赖项,但找不到它们。

答案1

您似乎需要下载额外的 Debian 软件包,但您的sources.list文件不包含完整的在线 Debian 软件包存储库。

有几个人遇到过这个问题。[1]发生这种情况的原因之一是 Debian 安装程序没有看到互联网连接。或者您可能在某个时候删除了存储库:-)。

确保您的/etc/apt/sources.list文件包含以下行:

# Debian release 9.x
deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main

# Security updates
deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main

然后跑apt update。然后使用命令再次尝试安装 apt install google-chrome-stable

(apt现在是交互式使用的推荐命令。 apt-get不太友好,特别是apt-get upgrade 不安装一些非常重要的安全更新.)

我不知道添加在线 Debian 存储库后会发生什么。即,如果您想从 USB (Debian DVD #1) 安装一些软件包,是否需要返回并删除在线存储库。


[1] 请参阅此链接的评论:如何在没有游戏、Office 等的情况下安装 Debian?

答案2

我不知道您遵循什么指南,但您所要做的就是转到此处:
https://www.google.com/chrome/index.html

点击“立即下载”即可下载软件包google-chrome-stable_current_amd64.deb

然后从您在本地下载的任何位置安装该软件包。

安装程序会在以下位置为您设置源/etc/apt/sources.list.d/google-chrome.list

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

答案3

帮助我libappindicator1在 Debian 和 Docker 中进行安装的就是手动安装这个软件包。另外,这还取决于另一项libindicator7

RUN curl -p --insecure "http://ftp.de.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-7_amd64.deb" --output libappindicator1_0.4.92-8_amd64.deb \
    && curl -p --insecure "http://ftp.de.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_amd64.deb" --output libindicator7_0.5.0-4_amd64.deb \
    && dpkg -i libindicator7_0.5.0-4_amd64.deb \
    && dpkg -i libappindicator1_0.4.92-8_amd64.deb \
    && rm libindicator7_0.5.0-4_amd64.deb \
    && rm libappindicator1_0.4.92-8_amd64.deb

相关内容