如何在不安装的情况下阅读包描述或手册页?

如何在安装包之前从终端获取有关包的信息?

我的意思是类似于man页,但在安装包之前也可访问。

不像联机帮助页那么广泛,但我认为这就是你要找的东西:

 apt-cache show  

你也可以搜索相关的包:

 apt-cache search  

dman检索手册页

在实践中, 查看包的简要描述(如mchid建议的)通常是您想要看到的,以决定您是否需要包。 但是,如果您愿意,可以使用dman实用程序查看尚未安装的软件包提供的联机帮助页。

dman由bikeshed 提供 安装自行车 包。 您可以在软件中心安装它,或者使用sudo apt-get install bikeshed

然后像man一样使用dman

dman是一个通过Internet检索手册页并显示它们的脚本,因此您必须连接到Internet才能成功使用它。 (但你可能是,因为在你的特定情况下你将要安装一个软件包。)它也经常运行缓慢,所以要准备好等几秒钟。

如果dman的数据库没有你的版本,你可以指定另一个。

由于一个bug, dman在某些版本的Ubuntu上无法正常工作。 现在,你可以通过查看你想要的另一个版本的联机帮助页来解决这个问题(这个解决方法是由Marius Gedminas在bug报告的评论中提出的 )。 你使用代号的形容词部分 ,在所有小写字母中(例如, precise的12.04精确穿山甲, trusty的14.04 Trusty Thar)。 例如:

 ek@Io:~$ dman sl # doesn't work on Vivid, produces no output ek@Io:~$ dman --release trusty sl SL(6) Games Manual SL(6) NAME sl - display animations aimed to correct users who accidentally enter sl instead of ls. SYNOPSIS sl [ -alFe ] DESCRIPTION sl Displays animations .... 

替代方案:使用(基于文本的)Web浏览器浏览手册页

当然,您也可以简单地浏览网页上的联机帮助页 。 如果要从命令行执行此操作,可以使用基于文本的Web浏览器 。

如果你愿意,你甚至可以在.bashrc定义一个函数 ,这样你就可以打开一个基于文本的Web浏览器并搜索作为参数传递的术语:

 wman() { links2 "http://manpages.ubuntu.com/cgi-bin/search.py?q=$1"; } 

要使特定的函数定义起作用,可以使用links2 安装links2 必须安装包。 它将导致在每个新创建的交互式shell中自动定义wman函数,但不会在编辑.bashrc之前启动的shell中定义(尽管可以在这些shell中简单地运行函数定义)。

然后我可以搜索手册页,并在手册的不同部分中选择页面,无论我喜欢哪种Ubuntu版本的手册:

 ek@Io:~$ wman chmod Ubuntu Manpage: Searching (p1 of 2) Ubuntu manuals _____________________ go +------------------------------------------------------------------------+ | lucid precise trusty utopic Section Description | | 10.04 LTS 12.04 LTS 14.04 LTS 14.10 | | chmod(1), chmod(1), chmod(1), chmod(1), (1) - Executable | | chmod(1) chmod(1) chmod(1) chmod(1) programs or shell | | commands | | chmod(2), chmod(2), chmod(2), chmod(2), (2) - System calls | | chmod(2) chmod(2) chmod(2) chmod(2) (functions provided by | | the kernel) | | (3) - Library calls | | chmod(3) chmod(3) chmod(3) chmod(3) (functions within | | program libraries) | | . . . . (4) - Special files | | (usually found in /dev) | | (5) - File formats and | | . . . . conventions eg | | /etc/passwd | | . . . . (6) - Games | | (7) - Miscellaneous | | . . . . (including macro | | packages and | http://manpages.ubuntu.com/ 

在我的意见中,如果不安装软件包,您将无法阅读文档。 当您安装任何特定的软件包时,您可能已经注意到还安装了一些其他文件,其中一个文件名为“man-db”或类似名称。

这个’man-db’实际上包含有关包的手册文档。

但你可以看到包的一些基本细节

 apt-cache show