Product SiteDocumentation Site

6.9. 搜索软件包

Debian 纳入的软件愈来愈多,出现自相矛盾的现象:Debian 的工具可以处理大部分的工作,但很难在众多的软件包中找到适合的工具。没有适当的方式搜索 (或找到) 正确的工具始终是个问题。幸运的是,此问题已经几乎全部解决了。
最琐碎的搜索可能是找到正确的软件包名称。若 apt show 软件包名称 送回结果,表示该软件包存在。不幸的是,必须知道或猜对软件包名称,却几乎是不可能的.
搜索纯文本的软件包名称,虽然有限但成功率较高。还可以搜索软件包说明的内容:除了搜索软件包名称、键词之外,还可搜索其说明。apt-cacheaxi-cache 是此等搜索的工具;例如,apt-cache search video 将找出名称或说明内有键词 “video” 的软件包。
更复杂的搜索,需要更有力的工具,如 aptitude 是其中之一。aptitude 可搜索软件包元数据字段的内容。例如,以下的范例搜索含有 kino 字样的软件包名称,其说明包括 video 与维护者名字为 paul
$ aptitude search kino~dvideo~mpaul
p   kino  - Non-linear editor for Digital Video data
$ aptitude show kino
Package: kino
Version: 1.3.4-2.2+b2
State: not installed
Priority: extra
Section: video
Maintainer: Paul Brossier <piem@debian.org>
Architecture: amd64
Uncompressed Size: 8300 k
Depends: libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libavc1394-0
         (>= 0.5.3), libavcodec57 (>= 7:3.2.4) | libavcodec-extra57 (>=
         7:3.2.4), libavformat57 (>= 7:3.2.4), libavutil55 (>= 7:3.2.4), libc6
         (>= 2.14), libcairo2 (>= 1.2.4), libdv4 (>= 1.0.0), libfontconfig1
         (>= 2.11), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:3.0),
         libgdk-pixbuf2.0-0 (>= 2.22.0), libglade2-0 (>= 1:2.6.4-2~), libglib2.0-0
         (>= 2.16.0), libgtk2.0-0 (>= 2.24.0), libice6 (>= 1:1.0.0),
         libiec61883-0 (>= 1.2.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0
         (>= 1.14.0), libpangoft2-1.0-0 (>= 1.14.0), libquicktime2 (>=
         2:1.2.2), libraw1394-11, libsamplerate0 (>= 0.1.7), libsm6, libstdc++6
         (>= 5.2), libswscale4 (>= 7:3.2.4), libx11-6, libxext6, libxml2 (>=
         2.7.4), libxv1, zlib1g (>= 1:1.1.4)
Recommends: ffmpeg, curl
Suggests: udev | hotplug, vorbis-tools, sox, mjpegtools, lame, ffmpeg2theora
Conflicts: kino-dvtitler, kino-timfx, kinoplus, kino-dvtitler:i386, kino-timfx:i386,
           kinoplus:i386, kino:i386
Replaces: kino-dvtitler, kino-timfx, kinoplus, kino-dvtitler:i386, kino-timfx:i386,
          kinoplus:i386
Provides: kino-dvtitler, kino-timfx, kinoplus
Description: Non-linear editor for Digital Video data
 Kino allows you to record, create, edit, and play movies recorded with DV camcorders.
 This program uses many keyboard commands for fast navigating and editing inside the
 movie.
 
 The kino-timfx, kino-dvtitler and kinoplus sets of plugins, formerly distributed as
 separate packages, are now provided with Kino.
Homepage: http://www.kinodv.org/
Tags: field::arts, hardware::camera, implemented-in::c, implemented-in::c++,
      interface::graphical, interface::x11, role::program, scope::application,
      suite::gnome, uitoolkit::gtk, use::editing, use::learning,
      works-with::video, x11::application
此搜索只找到一个软件包,kino,满足全部三个条件。
这种多条件的搜索较为刚性,所以很少人用它。因此发明新的标签系统,以不同角度处理搜索。软件包的标签在其他情况之外多了专题性分类,通称为 “层面性分类”。以前述的 kino 为例,软件包标签指出 Kino 是处理影像的 Gnome 级软件,主要功能为编辑。
Browsing this classification can help you to search for a package which corresponds to known needs; even if it returns a (moderate) number of hits, the rest of the search can be done manually. To do that, you can use the ~G search pattern in aptitude, but it is probably easier to simply navigate the site where tags are managed:
works-with::videouse::editing 标签可找出若干软件包,包括 kinopitivi 影像编辑器。愈来愈多人使用这种分类系统,在此基础上,软件包管理者创建更有效的接口。
总的来说,最好的工具取决于搜索时你所期望达到的复杂程度: