如何在 apt-get 中的正则表达式匹配中忽略冲突的包?

如何在 apt-get 中的正则表达式匹配中忽略冲突的包?

我正在尝试安装除了一个目前位于 Ubuntu 存储库中的 R 包:

但是,当我这样做时sudo apt-get install 'r-cran-*'出现错误:

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:
 r-cran-mass : Conflicts: r-cran-vr

好的,所以我想忽略这个冲突。 如何? 我看到了旗帜--ignore-missing,但这是一个冲突? 我没有看到任何--ignore-conflicted??选项

computer:~> sudo apt-get install 'r-cran-*' --ignore-conflict
E: Command line option --ignore-conflict is not understood
computer:~> sudo apt-get install 'r-cran-*' --ignore-conflicted
E: Command line option --ignore-conflicted is not understood

答案1

安装资质 ,启动全屏文本模式界面,然后选择所有r-cran-包。大多数 R 包都位于该gnu-r部分中,+在部分标题上输入将安装该部分中的所有包。为了更精确地匹配,请l按 限制显示并输入^r-cran-正则表达式,然后按“未安装的包”行。您将收到冲突通知,您可以通过按几次 来验证解决方案来+解决。.!

您也可以从命令行使用 aptitude。aptitude '~n^r-cran-.*'选择所有 r-cran- 包进行安装,然后选择所需的冲突解决方案。

如果您不想使用 aptitude 或者想要非交互式解决方案,您可以使用 生成软件包列表apt-cache r-cran-,因此:

apt-get install $(apt-cache r-cran- | grep -Fvx r-cran-vr)

相关内容