FreeBSD列出所有已安装的port/应用程序

时间:2019-11-20 08:54:03  来源:igfitidea点击:

如何列出FreeBSD操作系统下的所有安装软件包/应用程序?

使用pkg_info命令列出FreeBSD操作系统下所有已安装的软件包。

FreeBSD查看所有当前安装的软件包

输入命令:

# pkg_info

输出示例:

arcconf-v6.10.18359 Adaptec SCSI RAID administration tool
compat6x-amd64-6.4.604000.200810 A convenience package to install the compat6x libraries
cvsup-without-gui-16.1h_4 File distribution system optimized for CVS (non-GUI version
dnstop-20090128     Captures and analyzes DNS traffic (or analyzes libpcap dump
ezjail-3.0          A framework to easily create, manipulate and run FreeBSD ja
libiconv-1.11_1     A character set conversion library
libslang2-2.1.4_1   Routines for rapid alpha-numeric terminal applications deve
libtool-1.5.26      Generic shared library support script
most-5.0.0          A pager (like less) which has support for windows and binar
mysql-client-5.0.82 Multithreaded SQL database (client)
mysql-server-5.0.82 Multithreaded SQL database (server)
nagios-statd-3.12_1 Daemon/client to check remote host information for Nagios
openntpd-3.9p1_2,2  OpenBSD's Network Time Protocol daemon
p5-Lchown-1.00      A perl5 module providing access to lchown(2)
pcre-7.9            Perl Compatible Regular Expressions library
perl-5.8.9_3        Practical Extraction and Report Language
png-1.2.35          Library for manipulating PNG images
portaudit-0.5.12    Checks installed ports against a list of security vulnerabi
portmaster-2.7      Manage your ports without external databases or languages
python25-2.5.4_1    An interpreted object-oriented programming language
rsnapshot-1.3.1     Filesystem snapshot utility based on rsync(1)
rsync-3.0.6         A network file distribution/synchronization utility
screen-4.0.3_6      A multi-screen window manager

可以使用-a开关获取详细信息:

# pkg_info -a

或者

# pkg_info -a | less

或者

# pkg_info -a | grep package
# pkg_info -a | grep php5

获取有关软件包的详细信息

输入命令:

# pkg_info package_name
# pkg_info perl-5.8.9_3
# pkg_info 'perl*'

输出:

Information for perl-5.8.9_3:

Comment:
Practical Extraction and Report Language

Required by:
p5-Lchown-1.00
rsnapshot-1.3.1

Description:
Perl is a language that combines some of the features of C, sed, awk and
shell.  See the manual page for more hype.  There are also many books
published by O'Reilly & Assoc.  See pod/perlbook.pod for more
information.

WWW: http://www.perl.org/

- MarkM

FreeBSD查看软件包中的文件

-L选项显示软件包中的文件。

# pkg_info -L package-name
# pkg_info -L perl
# pkg_info -L -r 'perl*'

输出:

Information for perl-5.8.9_3:

Depends on:
Files:
/usr/local/man/man1/a2p.1.gz
/usr/local/man/man1/c2ph.1.gz
/usr/local/man/man1/corelist.1.gz
/usr/local/man/man1/cpan.1.gz
/usr/local/man/man1/dprofpp.1.gz
/usr/local/man/man1/enc2xs.1.gz
/usr/local/man/man1/find2perl.1.gz
/usr/local/man/man1/h2ph.1.gz
/usr/local/man/man1/h2xs.1.gz
/usr/local/man/man1/instmodsh.1.gz
/usr/local/man/man1/libnetcfg.1.gz
.....
...
....
/usr/local/lib/perl5/5.8.9/validate.pl
/usr/local/lib/perl5/5.8.9/vars.pm
/usr/local/lib/perl5/5.8.9/vmsish.pm
/usr/local/lib/perl5/5.8.9/warnings.pm
/usr/local/lib/perl5/5.8.9/warnings/register.pm