我正在尝试在我拥有的 VPS 上安装 Google Chrome。
VPSDebian GNU/Linux 11 (bullseye)
上有。
我用的ssh root@ip
是连接。我运行这些命令:
apt-get update
apt upgrade
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O chrome
dpkg -i chrome
但我看到这些错误:
(Reading database ... 73725 files and directories currently installed.)
Preparing to unpack chrome ...
Unpacking google-chrome-stable (107.0.5304.110-1) over (107.0.5304.110-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
google-chrome-stable depends on fonts-liberation; however:
Package fonts-liberation is not installed.
google-chrome-stable depends on libnspr4 (>= 2:4.9-2~); however:
Package libnspr4 is not installed.
google-chrome-stable depends on libnss3 (>= 2:3.26); however:
Package libnss3 is not installed.
google-chrome-stable depends on xdg-utils (>= 1.0.2); however:
Package xdg-utils is not installed.
dpkg: error processing package google-chrome-stable (--install):
dependency problems - leaving unconfigured
Processing triggers for mailcap (3.69) ...
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
google-chrome-stable
当我尝试安装时,fonts-liberation
我看到这些错误:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
google-chrome-stable : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed
Depends: libnss3 (>= 2:3.26) but it is not going to be installed
Depends: xdg-utils (>= 1.0.2) but it is not going to be installed
Recommends: libu2f-udev but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
我没有尝试,--fix-broken
因为我担心破坏这个 VPS 上的东西。
如何在 Debian 11 bullseye 上安全地安装 Google Chrome?
更新
这是以下的输出apt policy
:
root@3rag:~# apt policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages
release o=Docker,a=bullseye,l=Docker CE,c=stable,b=amd64
origin download.docker.com
500 http://security.debian.org/debian-security bullseye-security/main amd64 Packages
release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=main,b=amd64
origin security.debian.org
500 http://debian.mirror.serveriai.lt/debian bullseye/non-free amd64 Packages
release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=non-free,b=amd64
origin debian.mirror.serveriai.lt
500 http://debian.mirror.serveriai.lt/debian bullseye/contrib amd64 Packages
release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=contrib,b=amd64
origin debian.mirror.serveriai.lt
500 http://debian.mirror.serveriai.lt/debian bullseye/main amd64 Packages
release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=main,b=amd64
origin debian.mirror.serveriai.lt
Pinned packages:
root@3rag:~#
答案1
dpkg
只处理它给出的各个包,它不知道如何解决依赖关系;因此,当您运行时dpkg -i chrome
,它能够确定许多依赖项未得到满足,但它本身无法满足它们。它仍然安装了 Chrome 软件包,但未进行配置。
apt
这就是导致在后续输出中提到的原因:
You might want to run 'apt --fix-broken install' to correct these.
这样做(apt install -f
作为 root,与 相同apt --fix-broken install
)会安装缺少的包来解决已安装包的依赖关系。
为了避免将来出现这种情况,您可以apt
直接安装下载的包,并为其提供包的路径:
apt install ./chrome
或者
apt install ./google-chrome-stable_current_amd64.deb
无需重命名下载的文件。
答案2
根据我的经验,您可以安全地运行修复损坏的安装。最坏的情况是它会更新软件包,你将不得不恢复。您可以在 /var/log/apt/history.log 中找到它更新/修复的内容,包括版本号。
[免责声明] 它是开源的,YMMV。