为什么执行“apt-cache search postgresql”时没有列出“postgresql”包?

为什么执行“apt-cache search postgresql”时没有列出“postgresql”包?

我只需要在我的计算机上安装 postgresql 服务器,因此我执行以下操作:

apt-cache search postgresql

它列出了一系列与 postgresql 相关的软件包:

[...]
postgis - Geographic objects support for PostgreSQL -- common files
postgresql-8.4 - object-relational SQL database, version 8.4 server
postgresql-9.1-debversion - Debian version number type for PostgreSQL
postgresql-9.1-ip4r - IPv4 and IPv4 range index types for PostgreSQL 9.1
postgresql-9.1-orafce - Oracle support functions for PostgreSQL 9.1
[...]
postgresql-server-dev-8.4 - development files for PostgreSQL 8.4 server-side programming
postgresql-server-dev-all - extension build tool for multiple PostgreSQL versions
proftpd-mod-pgsql - Versatile, virtual-hosting FTP daemon - PostgreSQL module
ptop - PostgreSQL performance monitoring tool akin to top
[...]

然而,尽管该包存在,但实际postgresql并未列出。

$ apt-cache show postgresql
Package: postgresql
Priority: optional
Section: database
Installed-Size: 63
Maintainer: Martin Pitt <[email protected]>
Original-Maintainer: Martin Pitt <[email protected]>
Architecture: all
Source: postgresql-common (129ubuntu1)
Version: 9.1+129ubuntu1
Depends: postgresql-9.1
Filename: pool/main/p/postgresql-common/postgresql_9.1+129ubuntu1_all.deb
Size: 5552
MD5sum: 0bee83a4dab3e1d236fb4de1abcbf5c2
SHA1: f58d51b7f855c10959078b6ed8c3ea22dd3293ac
SHA256: ec0a12dabb52fee21f8576d5bd0990df6827e551dcd9b24f950d3ca4564d2761
Description-en: object-relational SQL database (supported version)
 This metapackage always depends on the currently supported PostgreSQL
 database server version.
 .
 PostgreSQL is a fully featured object-relational database management
 system.  It supports a large part of the SQL standard and is designed
 to be extensible by users in many aspects.  Some of the features are:
 ACID transactions, foreign keys, views, sequences, subqueries,
 triggers, user-defined types and functions, outer joins, multiversion
 concurrency control.  Graphical user interfaces and bindings for many
 programming languages are available as well.
Description-md5: bdff2d6e5b2a1dd00e72b3ed8729d9ac
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: postgresql-server

Package: postgresql
Priority: optional
Section: database
Installed-Size: 63
Maintainer: Martin Pitt <[email protected]>
Original-Maintainer: Martin Pitt <[email protected]>
Architecture: all
Source: postgresql-common (129)
Version: 9.1+129
Depends: postgresql-9.1
Filename: pool/main/p/postgresql-common/postgresql_9.1+129_all.deb
Size: 5508
MD5sum: 1ea1455e036c0a058145f19c6e92ef3f
SHA1: 8e73a616a686ec1130dc01858ee07e7ce8eb1caa
SHA256: a21adb533516e79145d93d57279db69260e644d259c39bb06f7e17d26721ac4b
Description-en: object-relational SQL database (supported version)
 This metapackage always depends on the currently supported PostgreSQL
 database server version.
 .
 PostgreSQL is a fully featured object-relational database management
 system.  It supports a large part of the SQL standard and is designed
 to be extensible by users in many aspects.  Some of the features are:
 ACID transactions, foreign keys, views, sequences, subqueries,
 triggers, user-defined types and functions, outer joins, multiversion
 concurrency control.  Graphical user interfaces and bindings for many
 programming languages are available as well.
Description-md5: bdff2d6e5b2a1dd00e72b3ed8729d9ac
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: postgresql-server

我可以通过在 Ubuntu 上搜索如何安装 postgresql 来找到它(apt-get install postgresql)但我仍然想知道为什么它没有列出apt-cache search

答案1

啊,这个包确实被列出了,但我错误地认为搜索结果是按字母顺序排列的,所以我错过了。出于某种奇怪的原因,列表中的某些部分似乎是有序的,而其他部分则不是。

apt-cache search --names-only postgresql也有助于减少结果。

相关内容