I've done my homework: searched, tried and read conda documentation. However, I could not find the answer to this seeming common and simple task: List files that belong to an installed package. How do I do that?
My conda version: conda 4.3.30
I've looked at list, info, search, and package
subcommands.
My use cases for this:
When a package 'A' installed another package 'B' as its dependency. But B has a bug, or the installation somehow broken, I want to check which files B installed.
An extended use: when commands of A calls some command b
of B, but I don't know the exact name of B. A 'reverse' search based on b
to find out B and lets me read more about it.
You can use the repoquery command which is part of the yum-utils to list files installed on a CentOS/RHEL system from a given package. Important: In Fedora 22+ version, the repoquery command is integrated with dnf package manager for RPM based distribution to list files installed from a package as shown above.
log | grep “\ install\ “ command is probably the best way of viewing a list of installed packages, because only “install” entries in the log file are displayed. If you need to view installed packages that are older than those available in the dpkg.
The ls command is used to list files.
To list the files of an installed package, we can execute the following command (the ‘$dpkg’ is the name of the package for which the list of files is required) $ dpkg -L < package_name > You can find out which a.deb package will install files through the following simple dpkg command. $ dpkg-deb -c / home / ubuntu / Desktop / example.deb
How to list all files installed by RPM package 1 -q : this is a general rpm query 2 -l : list package content 3 -p : package name More ...
To see all the files the package installed onto your system, do this: dpkg-query -L <package_name>. To see the files a .deb file will install. dpkg-deb -c <package_name.deb>. To see the files contained in a package NOT installed, do this once (if you haven't installed apt-file already: sudo apt-get install apt-file sudo apt-file update.
Scroll down to ‘Search package directories’. Type your package name in the keyword field. Check the ‘Show exact matches’ box. Select your distribution. Press the ‘Search button. Specify your architecture and the desired package on the next page. Click on ‘list of files’ next to your architecture to get the list of the files in the specific package.
Assuming you have activated the relevant anaconda environment, you can look at the file ${CONDA_PREFIX}/conda-meta/<package-name-and-version>-<hash>.json
and look for the files
element.
(this works with Miniconda on Linux)
Found out that all packages that conda installed are stored under <root_environment>/pkgs
. One can find out about root environment
and other information by running conda info
.
Then to list files that a package has:
tree <root_environment>/pkgs/<package_name>-<package_version>
or with find
, one can also find which downloaded package has the command:
find <root_environment> -type f -iname 'somecommand'
<root_environment>
here is a placeholder for something like ~/anaconda
if one installed anaconda into ~/anaconda
This solution is rather *nix-specific but it is good enough to me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With