Ubuntu 相当于 Yum 的 WhatProvides,查找哪个包提供了文件

发布于 2024-10-08 11:05:30 字数 296 浏览 8 评论 0原文

Fedora 的 yum 包管理工具有一个名为 whatprovides 的不错选项,它可以让您找到哪个包安装了特定的二进制文件或文件。 Ubuntu 上的等效命令是什么?

例如,假设我想查找 /usr/bin/mysqladmin 提供了哪些包。我知道它应该类似于 mysql-server* 。我读过 apt-cache search blah 是一个类似的命令,但运行 apt-cache search /usr/bin/mysqladmin 不会返回任何内容。有更好的命令吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仲春光 2024-10-15 11:05:30

我相信 apt-file 会给你你想要的。

$ 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

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
素染倾城色 2024-10-15 11:05:30

我使用 dpkg -S filename 来实现此目的。它无法搜索系统上未安装的文件,但它默认包含在所有 dpkg 发行版中,而 apt-file 则不然。

您还可以使用 http://packages.ubuntu.com/< 查找系统上未安装的文件/a> 网站。

I use dpkg -S filename for that. It can't search for files that are not installed on your system with it, but it's shipped in all dpkg distros by default while apt-file is not.

You also can look that up for files that are not installed on your system using http://packages.ubuntu.com/ website.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文