![]() Your syntax for locate is correct, but you may have to run sudo updatedb first. Adding sudo allows it to search in all folders/subfolders. Also, type -f means search for files, not folders. means search only in the current directory, it is best to search everything from root if you really dont know. Got more useful commands to share? Let it know in the comments and we add them to the article. sudo find / -type d -name 'postgis-2.0.0' The. Systems running the distributions from SuSE can use the zypper tool to find the link between a file and a package. Next alternative is qlist, which is part of app-portage/portage-utils The first option is using equery, which is part of the package app-portage/gentoolkit. Let’s do the same for the at package and see what it exactly installs (and where). If you already know the package name, you can quickly look up the files that are installed by a Debian package. Without the awk command, the output will look like this. Using the find command is another option, but may be less efficient. With the dpkg package management tool we can find the related package.ĭpkg -S /usr/sbin/atd | awk -F: ‘’ If you know the binary, then use the which command to discover where it is stored. If you want to find the related package of a binary (or file), we first have to know the full path. Debian and Ubuntu Discover related package This data is less easy to parse due to the different types of lines. This will give you possibly multiple hits, as a file can be part of packages from different repositories. With yum you can do a similar request to see the related package.Īnd with DNF there is the provides argument. To just see the package name, use the –queryformat option. The output will provide the package and its version. If you have the file name, you can turn this around and find the related package. To show what files are in a package, use the rpm command. Use the -q option with dnf to show only the relevant output. ![]() The package itself does not have to be installed. If you use dnf, then you can query files from the packages that are in your repositories. Rpm -qlp /path/to/file.rpm Show files for packages on the repository CentOS, Fedora, RHEL Show files for RPM packages We have gathered this information for multiple Linux distributions. In this article we have a look at several ways to determine the relationships between files and the package they belong to. ![]() This is of great help during system hardening or general system cleanups. Sometimes you want to know the related package of a file, before installation, or when it is already there. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |