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

Yas*_*har 10 package-management documentation manpage

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

我的意思是类似man页面的东西,但即使在安装包之前也可以访问。

Eli*_*gan 13

dman 检索手册页

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

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

然后使用dmanman

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

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

由于错误 dman在某些版本的 Ubuntu 上无法正常工作。现在,您可以通过查看所需联机帮助页的另一个版本版本来解决该问题(Marius Gedminas对错误报告的评论中建议了此解决方法)。您使用代号的形容词部分,全部小写(例如,precise来自 12.04 Precise Pangolin,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....
Run Code Online (Sandbox Code Playgroud)

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

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

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

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

为了使该特定函数定义起作用,links2 安装链接2必须安装包。它会导致wman函数在每个新创建的交互式 shell 中自动定义,但不会在.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/
Run Code Online (Sandbox Code Playgroud)

  • +1 `dman` 是一个非常有用的想法。 (2认同)

mch*_*hid 10

不像联机帮助页那样广泛,但我认为这就是您要查找的内容:

apt-cache show <packagename>
Run Code Online (Sandbox Code Playgroud)

您还可以搜索相关软件包:

apt-cache search <searchtag>
Run Code Online (Sandbox Code Playgroud)