Solved How to find out the name of the port, given the command name it provides?

Hello!

(I'm still new)

I see cargo man page in the latest 14 release (it's the package manager for Rust programs).
It's in ports somewhere (if I specify only "RELEASE" in search option, I get no results). I want to find out the name of the port that provides this cargo command.

The three main ways to search for ports (the pkg search, make search key=cargo, and freshports website) all return same 7 packages. None of them provide the cargo command (tried them all, pkg install).

Hopefully this is a quick and easy question, but I couldn't find the answer. Thank you.
 
Welcome to The FreeBSD Forums.

Code:
% pkg provides bin/cargo$
Name    : rust-nightly-1.79.0.20240317
Comment : Language with a focus on memory safety and concurrency
Repo    : FreeBSD-ports
Filename: usr/local/bin/cargo

Name    : rust-1.77.0
Comment : Language with a focus on memory safety and concurrency
Repo    : FreeBSD-ports
Filename: usr/local/bin/cargo
%

ports-mgmt/pkg-provides

pkg-provides(8)
 
Note the package message if you install provides.
On install: In order to use the pkg-provides plugin you need to enable plugins in pkg. To do this, uncomment the following lines in /usr/local/etc/pkg.conf file and add pkg-provides to the supported plugin list: PKG_PLUGINS_DIR = "/usr/local/lib/pkg/"; PKG_ENABLE_PLUGINS = true; PLUGINS [ provides ]; After that run `pkg plugins' to see the plugins handled by pkg. On upgrade: To update the provides database run `pkg provides -u`

It's very handy.

The second link grahamperrin provided gives that info, but if you're always in a hurry like me, and doing a bunch of stuff at once, it can be missed. Then you run provides whatever and get nothing back. (err, at least that's what I've heard happens). :)
 
… run provides whatever and get nothing back. (err, at least that's what I've heard happens). :)

I guess, it's proper to get nothing for a port that is never packaged in FreeBSD Project-provided repos.

For example:

Code:
% pkg info --list citrix_ica | grep bin/
        /usr/local/bin/wfcmgr
        /usr/local/bin/wfica
% pkg provides bin/wfica
% pkg rquery %o citrix_ica
% pkg query %o citrix_ica
net/citrix_ica
%

<https://www.freshports.org/net/citrix_ica/#add> "… We doubt a package is available for this port because …"
 
Note the package message if you install provides.

Incidentally,

Code:
% pkg rquery %M pkg-provides

% pkg query %M pkg-provides
On install:
In order to use the pkg-provides plugin you need to enable plugins in pkg.
To do this, uncomment the following lines in /usr/local/etc/pkg.conf file
and add pkg-provides to the supported plugin list:

PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [ provides ];

After that run `pkg plugins' to see the plugins handled by pkg.

On upgrade:
To update the provides database run `pkg provides -u`.

%

Where the first of those two commands found nothing, it should have been disallowed.

pkg-rquery(8) does not show messages of packages · Issue #1921 · freebsd/pkg
 
Back
Top