如何发现实用程序所属的包

Sim*_*Sim 8 package-management apt

我使用 NVIDIA 主页上的官方 .deb 安装了 CUDA。但是我遇到了一些麻烦,想重做安装以确保沿途的每一步都按预期工作。

因此我 'apt-get purge cuda...'

但是现在我仍然有 nvcc 这让我感到困惑,因为我期望它属于 cuda 包。

如何确定 nvcc 属于哪个包?

A.B*_*.B. 10

请检查apt-file因为在您的情况下nvcc是包 ( nvidia-cuda-toolkit) 的一部分。

首先你必须安装 apt-file

sudo apt-get install apt-file
sudo apt-file update
Run Code Online (Sandbox Code Playgroud)

现在开始

apt-file search nvcc
Run Code Online (Sandbox Code Playgroud)

或者

apt-file search --regex /nvcc$
Run Code Online (Sandbox Code Playgroud)

或者

apt-file search $(which nvcc)
Run Code Online (Sandbox Code Playgroud)

要检查nvidia-cuda-toolkit安装包的原因,请使用aptitude.

sudo apt-get install aptitude
aptitude why nvidia-cuda-toolkit
Run Code Online (Sandbox Code Playgroud)


abl*_*igh 6

最简单的方法是dpkg -S.

因此,要找出在哪个包zgrep中,请尝试:

$ dpkg -S `which zgrep`
gzip: /bin/zgrep
Run Code Online (Sandbox Code Playgroud)

这表明它在包中gzip

当然,您可以只使用文件的路径,例如:

$ dpkg -S /usr/share/dict/words
diversion by dictionaries-common from: /usr/share/dict/words
diversion by dictionaries-common to: /usr/share/dict/words.pre-dictionaries-common
dictionaries-common, wamerican: /usr/share/dict/words
Run Code Online (Sandbox Code Playgroud)

这顺便说明了一个更复杂的例子。