You are not logged in.

#1 2021-01-18 21:46:58

deicosaic
Member
Registered: 2021-01-18
Posts: 4

[SOLVED] pacman: How to search which package provides the executable?

I know of one way to search for the owner package of the specified executable:

$ pacman -Qo pacman
/usr/bin/pacman is owned by pacman 5.2.2-3

But often i run into cases when it can't find the owner:

$ pacman -Qo nft
error: No package owns nft
$ pacman -Qo usr/bin/nft
error: No package owns usr/bin/nft

And this is obviously not the case, because pacman does, indeed, has a package that provides usr/bin/nft:

$ pacman -Fl nftables
<...>
nftables usr/bin/
nftables usr/bin/nft
<...>

In this case, i don't have the nftables package installed on my system.

How should i search for packages-owners (or providers) of files if they are not installed on my system?

Last edited by deicosaic (2021-01-18 22:27:41)

Offline

#2 2021-01-18 21:52:04

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: [SOLVED] pacman: How to search which package provides the executable?

If pacman can’t find an owner of a file, in particular under “/usr”, it means you have polluted your system with software installed by something other than pacman. Now you start seeing first problems caused by that. You will see more of them later, starting with file conflicts, broken optdepends and having outdated software.

As for the last part: pacman -F uses information about packages available in the repos, not about your locally installed packages. Yes, if the repos contain a package nftables that contains file “/usr/bin/nft”, it will be reported by pacman -F. But that tells nothing about your system, on which this package seems to not be installed.

Last edited by mpan (2021-01-18 21:53:55)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2021-01-18 21:54:28

deicosaic
Member
Registered: 2021-01-18
Posts: 4

Re: [SOLVED] pacman: How to search which package provides the executable?

This is the thing --- i want to find a provider of the executable. In the example above, i do not have nftables installed, and i do not have the nft executable.

So i want to find out that if i want to obtain the nft executable, i should install the package "nftables".

Offline

#4 2021-01-18 22:07:29

snakeroot
Member
Registered: 2012-10-06
Posts: 164

Re: [SOLVED] pacman: How to search which package provides the executable?

deicosaic wrote:

This is the thing --- i want to find a provider of the executable. In the example above, i do not have nftables installed, and i do not have the nft executable.

So i want to find out that if i want to obtain the nft executable, i should install the package "nftables".

Yes you should.

Offline

#5 2021-01-18 22:16:00

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [SOLVED] pacman: How to search which package provides the executable?

deicosaic wrote:

This is the thing --- i want to find a provider of the executable.


Try pkgfile:

% pkgfile nft
extra/nftables

And the web interface can list files in packages not installed on your system: https://archlinux.org/packages/extra/x8 … les/files/


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2021-01-18 22:21:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: [SOLVED] pacman: How to search which package provides the executable?

Ah ... I'm confused, this is exactly what `pacman -F` is for.  Don't bother with pkgfile - that was the solution before the -F flag was added to pacman:

$ pacman -F nft
extra/nftables 1:0.9.7-3
    usr/bin/nft

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2021-01-18 22:23:54

deicosaic
Member
Registered: 2021-01-18
Posts: 4

Re: [SOLVED] pacman: How to search which package provides the executable?

graysky wrote:

Try pkgfile

Thank you, this is exactly the thing i was looking for.

Offline

#8 2021-01-18 22:25:21

deicosaic
Member
Registered: 2021-01-18
Posts: 4

Re: [SOLVED] pacman: How to search which package provides the executable?

Trilby wrote:

Ah ... I'm confused, this is exactly what `pacman -F` is for

This works very well too, thank you.

Offline

#9 2021-01-19 03:16:35

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] pacman: How to search which package provides the executable?

If you mentioned pacman -F in the first place, I'm curious why you needed to be told that "yes, use pacman -F for this".

Aside: it is true that pkgfile "was the solution before the -F flag was added to pacman", but that doesn't mean it stopped being *a* solution now.

pkgfile has more options than pacman -F, some of which I rely on -- and additionally, it is faster (in part, but not entirely, because it preprocesses the database, then repacks it into an uncompressed-by-default cache).


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB