Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu equivalent of Yum's WhatProvides, to find which package provides a file

Tags:

Fedora's yum package management tool has a nice option called whatprovides, which lets you find what package has installed a specific binary or file. What is the equivalent command on Ubuntu?

For example, say I'd like to find what package provided /usr/bin/mysqladmin. I know it should be something like mysql-server*. I've read that apt-cache search blah is a similar command, but running apt-cache search /usr/bin/mysqladmin returns nothing. Is there a better command?

like image 641
Cerin Avatar asked Dec 17 '10 14:12

Cerin


People also ask

How can I tell which package provides a file?

1. Using apt-file to find the package that provides a file (for repository packages, either installed or not installed) apt-file indexes the contents of all packages available in your repositories, and allows you to search for files in all these packages.

What package provides a file Ubuntu?

Installing apt-file: You can easily find the name of the package which provides a specific file/executable on Ubuntu using apt-file. apt-file is available in the official package repository of Ubuntu 20.04 LTS.

How do I search for specific packages in Ubuntu?

In Ubuntu and Debian systems, you can search for any package just by a keyword related to its name or description through the apt-cache search. The output returns you with a list of packages matching your searched keyword. Once you find the exact package name, you can then use it with the apt install for installation.

How do you check which RPM a file belongs to?

To show what files are in a package, use the rpm command. If you have the file name, you can turn this around and find the related package. The output will provide the package and its version. To just see the package name, use the –queryformat option.


1 Answers

I believe apt-file will give you what you want.

$ apt-file update $ apt-file list mysqladmin kmysqladmin: /usr/bin/kmysqladmin  $ apt-file search mysqladmin autoconf-archive: /usr/share/aclocal/ac_prog_mysqladmin.m4 autoconf-archive: /usr/share/autoconf-archive/html/ac_prog_mysqladmin.html bash-completion: /etc/bash_completion.d/mysqladmin kmysqladmin: /usr/bin/kmysqladmin  $ apt-file search mysqladmin mysql-admin: /usr/share/mysql-gui/administrator/mysqladmin_health.xml mysql-admin: /usr/share/mysql-gui/administrator/mysqladmin_startup_variables_description.dtd mysql-admin: /usr/share/mysql-gui/administrator/mysqladmin_startup_variables_description.xml mysql-admin: /usr/share/mysql-gui/administrator/mysqladmin_status_variables.xml mysql-admin: /usr/share/mysql-gui/administrator/mysqladmin_system_variables.xml mysql-client-5.1: /usr/bin/mysqladmin mysql-client-5.1: /usr/share/man/man1/mysqladmin.1.gz mysql-cluster-client-5.1: /usr/bin/mysqladmin mysql-cluster-client-5.1: /usr/share/man/man1/mysqladmin.1.gz mysql-testsuite: /usr/lib/mysql-testsuite/r/mysqladmin.result mysql-testsuite: /usr/lib/mysql-testsuite/t/mysqladmin.test 
like image 85
Glen Solsberry Avatar answered Nov 08 '22 09:11

Glen Solsberry