Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List installed files of a package?

Tags:

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:

  1. 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.

  2. 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.

like image 663
biocyberman Avatar asked Nov 06 '17 13:11

biocyberman


People also ask

How do I list files in a package?

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.

How do I display the list of installed software packages files?

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.

Which command is used to list out the files in package?

The ls command is used to list files.

How to list the files of an installed package in Ubuntu?

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?

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 ...

How do I check if a package is installed or not?

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.

How do I find the files in a specific package?

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.


2 Answers

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)

like image 72
Andre Holzner Avatar answered Oct 03 '22 17:10

Andre Holzner


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.

like image 42
biocyberman Avatar answered Oct 03 '22 17:10

biocyberman