gpt4 book ai didi

linux - linux安装软件时如何解决循环依赖?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:56:04 26 4
gpt4 key购买 nike

我是计算机界的新手。 我的目的是找出一种通用方法来解决在 Linux 上安装新软件时的循环依赖性(如果存在的话)。这里我用谷歌浏览器的案例来更好地说明我的问题。在安装 Google chrome(同时使用包管理器和 apt-get)时,我遇到了以下问题:

Selecting previously unselected package google-chrome-stable.
(Reading database ... 262709 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (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.

为了解决上述错误,我尝试安装 libappindicator1 但返回另一个依赖项错误:

The following packages have unmet dependencies:
libappindicator1 : Depends: libindicator7 (>= 0.4.90) but it is not going to be installed

现在我们遇到了循环依赖。尝试安装 libindicator7 时收到以下错误:

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:
google-chrome-stable : Depends: libappindicator1 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

如您所见,由于依赖关系,我无法安装该软件包。现在,一种方法是使用 apt-get -f install 并让 Linux 神奇地完成它的工作。但这不会教我太多。使用这个例子(或建议一个更好的例子),我们能否找出更好的方法来解决循环依赖问题?如果这是在安装新软件时的循环依赖的独立案例,或者我在解释错误时犯了错误,那么我可以删除这个问题。

一些有用的链接-

[1]: https://askubuntu.com/questions/764040/im-having-a-hard-time-installing-google-chrome-on-16-04-lts-please-help [2]: How to solve Cyclic Dependency [3]:How to Solve Circular Dependency [4]:cyclic dependency ... how to solve?

最佳答案

问题是使用 dpkg 安装 google-chrome-stable。 DPKG 现在确实安装了所需的依赖项并使系统处于损坏状态。

sudo apt install ./google-chrome-stable.deb

这将安装具有所需依赖项的包。

dpkg 只安装一个包,所以执行 dpkg -i packageName.deb 只会安装这个 Deb 包,并会通知你任何需要安装的依赖项,但它不会安装它们,也不会配置 packageName.deb,因为......依赖项不存在。

apt 是一个包管理系统,用于处理 Deb 包在基于 Debian 的 Linux 发行版上的安装。包管理系统是一组工具,可帮助您轻松安装、删除和更改包。所以 apt 就像一个聪明的 dpkg

关于linux - linux安装软件时如何解决循环依赖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41663844/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com