[实践OK]FreeBSD中安装pkg,pkg_add已经改用pkg了,怎样查询一个文件属于哪个ports包,类似CentOS里面的rpm -qf file反查在哪你上rpm包里面一样的命令是pkg which /usr/local/lib/libicuio.so.58

jackxiang 2020-2-27 00:33 | |
root@freebsd-unmp-10-10-0-237:~ # pkg_add -r wget
pkg_add: Command not found.
root@freebsd-unmp-10-10-0-237:~ # pkg install wget
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.16.3...
Extracting pkg-1.16.3: 100%
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.txz: 100%    6 MiB 407.3kB/s    00:16    
Processing entries: 100%
FreeBSD repository update completed. 30360 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        gettext-runtime: 0.21
        indexinfo: 0.3.1
        libidn2: 2.3.0_1
        libunistring: 0.9.10_1
        wget: 1.21

Number of packages to be installed: 5

The process will require 7 MiB more space.
1 MiB to be downloaded.

Proceed with this action? [y/N]:
摘自:http://www.ittang.com/2008/0309/4832.html
kg install pkg and let it bootstrap / upgrade itself. Then use pkg install foo, etc. pkg_add does not exist anymore, as you've found out.


man pkg
which   Query the database for package(s) that installed a specific file.

pkg which /usr/local/lib/libicuio.so.58
/usr/local/lib/libicuio.so.58 was installed by package icu-58.2_2,1

#pkg which /usr/local/bin/openssl
/usr/local/bin/openssl was installed by package openssl-1.0.2l,1

来自:https://www.howtoing.com/pkg-command-examples-to-manage-packages-in-freebsd


附:从Ports存储库本地下载软件包
为了从Ports存储库本地下载软件包,而不在系统上安装软件包,请使用fetch开关运行pkg命令 。

下载的软件包二进制文件是压缩的.txz文件,可以在/ var / cache / pkg / system路径中找到。

# pkg fetch package_name

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/10436/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2021-5-5 23:28
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]