在Arch Linux中搜索一个包

2025-10-21 14:06:04

1、如何用pacman搜索包?

pacman的语法如下:

pacman -Ss {pkgNameHere}pacman -Ss {keyWordHere}假如要搜索nmap包:

$ pacman -Ss nmap

或者是$ pacman -Ss auditing

示例输出:

extra/nmap 7.40-2

    Utility for network discovery and security auditing

community/dsniff 2.4b1-26

    Collection of tools for network auditing and penetration testing

community/lynis 2.4.8-1

    Security and system auditing tool to harden Unix/Linux systems

community/perf 4.11-1 (linux-tools)

    Linux kernel performance auditing tool

2、如何使用pkgfile搜索包?

pkgfile命令只不过是一个pacman .files元数据资源管理器。首先安装pkgfile,执行:

$ sudo pacman -S pkgfile

示例输出:

在Arch Linux中搜索一个包

3、键入以下命令来更新索引:$ sudo pkgfile --update

示例输出:

:: Updating 3 repos...

  download complete: core                 [   693.9 KiB   208K/s  2 remaining]

  download complete: extra                [     7.1 MiB   807K/s  1 remaining]

  download complete: community            [    15.5 MiB  48.6K/s  0 remaining]

:: download complete in 325.94s           <    23.2 MiB  73.0K/s  3 files    >

:: waiting for 1 process to finish repacking repos...

4、简单搜索

键入命令:$ pkgfile nginx$ pkgfile php$ pkgfile nmap

输出:

extra/bash-completion

extra/nmap

5、如何显示远程包提供的文件,即卸载包?

语法是示:$ pkgfile -l packageName$ pkgfile -l nmap$ pkgfile -l bash

示例输出:

core / bash / etc /

core / bash /etc/bash.bash_logout

core / bash /etc/bash.bashrc

core / bash / etc / skel /

core / bash /etc/skel/.bash_logout

core / bash /etc/skel/.bash_profile

core / bash /etc/skel/.bashrc

core / bash / usr /

core / bash / usr / bin /

core / bash / usr / bin / bash

core / bash / usr / bin / bashbug

core / bash / usr / bin / sh

core / bash / usr / include /

core / bash / usr / include / bash /

core / bash /usr/include/bash/alias.h

core / bash /usr/include/bash/array.h

core / bash /usr/include/bash/arrayfunc.h

core / bash /usr/include/bash/assoc.h

....

...

....

core / bash / usr / share / locale / zh_CN / LC_MESSAGES /

core / bash /usr/share/locale/zh_CN/LC_MESSAGES/bash.mo

core / bash / usr / share / locale / zh_TW /

core / bash / usr / share / locale / zh_TW / LC_MESSAGES /

core / bash /usr/share/locale/zh_TW/LC_MESSAGES/bash.mo

core / bash / usr / share / man /

core / bash / usr / share / man / man1 /

core / bash /usr/share/man/man1/bash.1.gz

core / bash /usr/share/man/man1/bashbug.1.gz

要查看本地软件包提供的文件列表,请使用:

$ pacman -Ql bash

6、如何执行与正则表达式的匹配?

语法是:$ pkgfile -r regex$ pkgfile -r php*$ pkgfile -r nginx*

查看所有其他选项语法为:

$ pkgfile -h

输出:

pkgfile 17

Usage: pkgfile [options] target

 Operations:

  -l, --list              list contents of a package

  -s, --search            search for packages containing the target (default)

  -u, --update            update repo files lists

 Matching:

  -b, --binaries          return only files contained in a bin dir

  -d, --directories       match directories in searches

  -g, --glob              enable matching with glob characters

  -i, --ignorecase        use case insensitive matching

  -R, --repo        search a singular repo

  -r, --regex             enable matching with regular expressions

 Output:

  -q, --quiet             output less when listing

  -v, --verbose           output more

  -w, --raw               disable output justification

  -0, --null              null terminate output

 Downloading:

  -z, --compress[=type]   compress downloaded repos

 General:

  -C, --config      use an alternate config (default: /etc/pacman.conf)

  -h, --help              display this help and exit

  -V, --version           display the version and exit

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢