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 影像編輯器。愈來愈多人使用這種分類系統,在此基礎上,套件管理者建立更有效的介面。
總的來說,最好的工具視搜尋複雜度而定: