Chrom浏览器未安装

Chrom浏览器未安装

要安装 Chromium 浏览器,我输入:

sudo apt install chromium-browser

但后来我得到了几个错误。之后发生的情况如下:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 chromium-browser : Depends: libnss3 (>= 2:3.22) but 2:3.21-1ubuntu4 is to be installed
                    Depends: chromium-codecs-ffmpeg-extra (= 86.0.4240.75-0ubuntu0.16.04.1) but 76.0.3809.100-0ubuntu0.16.04.1 is to be installed or
                             chromium-codecs-ffmpeg (= 86.0.4240.75-0ubuntu0.16.04.1) but it is not going to be installed
                    Recommends: chromium-browser-l10n but it is not going to be installed
 google-chrome-stable:amd64 : Depends: libasound2:amd64 (>= 1.0.16)
                              Depends: libatk-bridge2.0-0:amd64 (>= 2.5.3) but it is not going to be installed
                              Depends: libatk1.0-0:amd64 (>= 2.2.0) but it is not going to be installed
                              Depends: libatspi2.0-0:amd64 (>= 2.9.90) but it is not going to be installed
                              Depends: libcairo2:amd64 (>= 1.6.0) but it is not going to be installed
                              Depends: libcups2:amd64 (>= 1.4.0) but it is not going to be installed
                              Depends: libdrm2:amd64 (>= 2.4.38) but it is not going to be installed
                              Depends: libexpat1:amd64 (>= 2.0.1) but it is not going to be installed
                              Depends: libgbm1:amd64 (>= 8.1~0) but it is not going to be installed
                              Depends: libgdk-pixbuf2.0-0:amd64 (>= 2.22.0) but it is not going to be installed
                              Depends: libgtk-3-0:amd64 (>= 3.9.10) but it is not going to be installed
                              Depends: libnspr4:amd64 (>= 2:4.9-2~) but it is not going to be installed
                              Depends: libnss3:amd64 (>= 2:3.22) but it is not going to be installed
                              Depends: libpango-1.0-0:amd64 (>= 1.14.0) but it is not going to be installed
                              Depends: libpangocairo-1.0-0:amd64 (>= 1.14.0) but it is not going to be installed
                              Depends: libx11-6:amd64 (>= 2:1.4.99.1) but it is not going to be installed
                              Depends: libx11-xcb1:amd64 but it is not going to be installed
                              Depends: libxcb-dri3-0:amd64 but it is not going to be installed
                              Depends: libxcb1:amd64 (>= 1.9.2) but it is not going to be installed
                              Depends: libxcomposite1:amd64 (>= 1:0.3-1) but it is not going to be installed
                              Depends: libxdamage1:amd64 (>= 1:1.1) but it is not going to be installed
                              Depends: libxext6:amd64 but it is not going to be installed
                              Depends: libxfixes3:amd64 but it is not going to be installed
                              Depends: libxrandr2:amd64 but it is not going to be installed
                              Recommends: libu2f-udev:amd64 but it is not installable
                              Recommends: libvulkan1:amd64 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

请帮忙。

答案1

这不是 Chromium 的具体答案,而是此类问题的一般答案。

当源代码或套件开始与 apt 混合时,就会出现此问题。假设您尝试安装chromium-browser。 Ubuntubionic套件发布版本86.0.4240.75-0ubuntu0.18.04.1

当您尝试安装时chromium-browser,您会看到如下所示的一行:

Depends: 
  chromium-codecs-ffmpeg-extra (= 86.0.4240.75-0ubuntu0.16.04.1) 
                              but 76.0.3809.100-0ubuntu0.16.04.1 is to be installed
or
  chromium-codecs-ffmpeg (= 86.0.4240.75-0ubuntu0.16.04.1) 
                              but it is not going to be installed

答对了!

这意味着您的/etc/apt/sources.list/etc/apt/sources.list.d/*包含提供不同版本的 chromium 的源。

当查看官方 ubuntu 存储库我找到了这些版本:

  • 仿生:86.0.4240.75-0ubuntu0.16.04.1
  • xenial-更新:86.0.4240.75-0ubuntu0.16.04.1
  • 谢尼尔:49.0.2623.108-0ubuntu1.1233

由于您的版本介于 xenial 和 xenial-updates 之间,因此您似乎在非官方存储库中找到了该软件包。这可能是由于添加 PPA 或其他发行版的源引起的问题。

这是我对发生的事情的猜测:

  1. 您有一个更新的 apt 发布文件,其中包含官方 ubuntu 档案中的所有最新软件包,但其中还有一个未维护且与官方档案不同步的 PPA。
  2. 当您使用时apt install chromium-browserapt在套件中找到了首选版本bionic
  3. Apt 尝试安装该chromium-codecs-ffmpeg-extra or chromium-codecs-ffmpeg软件包。它发现的最高优先级命中来自这个未维护的 PPA。通常会选择找到的最高版本,但在这种情况下,此 PPA 优先。这可能是因为固定,或者您可能xenial为该 PPA 选择了源并且xenial优先级高于bionic您的计算机。
  4. apt在您的优先源中找到此版本时,它失败了,因为该版本无法满足依赖关系要求。

不要制作 FrankenDebian为什么添加不兼容的源是一个坏主意。

解决方案是清理您的/etc/apt/sources.list/etc/apt/sources.list.d/*

  1. 如果您正在使用,bionic请删除与其他版本相关的所有行(除了bionic-securitybionic-updates)。
  2. 如果您正在使用 PPA,请确保您确实需要该 PPA 中的某些内容。否则删除 PPA。如果 PPA 只是有较新版本的软件:不要患上闪亮新事物综合症。 PPA 不是受信任的来源,并且可以包含任何内容。它们也可能随时变得无法维护。获取官方版本中的最新版本。

答案2

运行命令添加 PPA:

sudo add-apt-repository ppa:xalt7x/chromium-deb-vaapi

运行命令“固定”PPA,以避免在 Ubuntu 20.04 中安装 snap 包:

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-xalt7x-chromium-deb-vaapi
Package: *
Pin: release o=LP-PPA-xalt7x-chromium-deb-vaapi
Pin-Priority: 1337
EOF

之后您可以通过以下方式安装浏览器:

sudo apt update

sudo apt install chromium-browser chromium-codecs-ffmpeg-extra 

PS - 从源列表中删除

sudo add-apt-repository --remove ppa:xalt7x/chromium-deb-vaapi

相关内容