Finding Software

    With so many packages available, it can be hard to find the exact thing you need using command-line APT. The general search tool is called apt-cache and is used like this:
howard@howard-OptiPlex-320:~$  apt-cache search kde
    Depending on which repositories you have enabled, that tool returns about a thousand packages. Many of those results will not even have KDE in the package name, but will be matched because the description contains the word KDE.
    You can filter through this information in several ways. First, you can instruct apt-cache to search only in the package names, not in their descriptions. This is done with the –n parameter, like this:
howard@howard-OptiPlex-320:~$  apt-cache –n search kde
    Now the search has gone down from more than 1,000 packages to a few hundred.
    Another way to limit search results is to use some basic regular expressions, such as ^,  eaning “start,” and $, meaning “end.” For example, you might want to search for programs that are part of the main KDE suite and not libraries (usually named something like libkde), additional bits (such as xmms-kde), and things that are actually nothing to do with KDE yet still match our search (like tkdesk). This can be done by searching for pack- ages that have a name starting with kde, as follows:
howard@howard-OptiPlex-320:~$   apt-cache –n search ^kde
    Perhaps the easiest way to find packages is to combine apt-cache with grep, to search within search results. For example, if you want to find all games-related packages for KDE, you could run this search:
howard@howard-OptiPlex-320:~$  apt-cache search games | grep kde
When you’ve found the package you want to install, run it through apt-get install as per usual. If you first want a little more information about that package, you can use apt- cache showpkg, like this:
howard@howard-OptiPlex-320:~$  apt-cache showpkg mysql-server-5.0
This shows information on “reverse depends” (which packages require, recommend, or suggest mysql-server-5.0), “dependencies” (which packages are required, recommended, or suggested to install mysql-server-5.0), and “provides” (which functions this package gives you). The “provides” list is quite powerful because it allows different packages to provide a given resource. For example, a MySQL database-based program requires MySQL to be installed, but isn’t fussy whether you install MySQL 4.1 or MySQL 5.0. In this situation, the Debian packages for MySQL 4.1 and MySQL 5.0 will both have “mysql-server-4.1” in the provides list, meaning that they offer the functionality provided by MySQL 4.1.
    Therefore, you can install either version to satisfy the MySQL-based application.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值