Finding Software
2013-11-18 08:15
253 查看
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.
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.
相关文章推荐
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- ubuntu下chrome无法同步问题解决
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- 以Ubuntu 9.04为例 将工作环境迁移到 Linux
- Scientific Linux 5.5 图形安装教程
- VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹
- 基于 Linux 集群环境上 GPFS 的问题诊断
- 从USB安装Ubuntu Server 10.04.3 图文详解
- 谁是桌面王者?Win PK Linux三大镇山之宝
- vivi下重新调整分区
- Linux-Ubuntu 10.04安装Cadence-ic610 方法总结图解
- Linux VS Unix:Linux欲一统天下 Unix不死