How can I get information about a package before installing it, from the terminal?

I mean something like man pages, but accessible even before the package is installed.


not as extensive as manpages but I think this is what you are looking for:

apt-cache show <packagename>

you can also search for related packages:

apt-cache search <searchtag>

dman Retrieves Manual Pages

In practice, viewing a package's brief description (as mchid suggests) is usually what you'll want to see, to decide if you want the package. However, if you like you can view a manpage provided by a package that has not yet been installed, using the dman utility.

dman is provided by the bikeshed Install bikeshed package. You can install that in the Software Center, or with sudo apt-get install bikeshed.

Then use dman like man.

dman is a script that retrieves manual pages over the Internet and displays them, so you have to be connected to the Internet to use it successfully. (But you probably are, because in your specific scenario you're about to install a package.) It also often runs slowly, so be prepared to wait several seconds.

If dman's database doesn't have your release, you can specify another.

Due to a bug dman doesn't work right on some releases of Ubuntu. For now you can get around the problem by viewing another release's version of the manpage you want (this workaround was suggested by Marius Gedminas in a comment on the bug report). You use the adjective part of the codename, in all lower case (e.g., precise from 12.04 Precise Pangolin, trusty from 14.04 Trusty Thar). For example:

ek@Io:~$ dman sl       # doesn't work on Vivid, produces no output
ek@Io:~$ dman --release trusty sl

SL(6)                            Games Manual                            SL(6)

       sl  -  display animations aimed to correct users who accidentally enter
       sl instead of ls.

       sl [ -alFe ]

       sl Displays animations....

Alternative: Browse Manual Pages with a (Text-Based) Web Browser

Of course, you can also simply browse the manpages on the web. If you want to do this from the command-line, you can use a text-based web browser.

If you like, you could even define a function in .bashrc so you have a command that opens up a text-based web browser and searches for the term passed as its argument:

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

For that particular function definition to work, the links2 Install links2 package must be installed. It will cause the wman function to be defined automatically in each newly created interactive shell, but not in shells that were started before .bashrc was edited (you could simply run the function definition in those shells, though).

Then I can search for manual pages, and select between pages in different sections of the manual, for whichever Ubuntu release's version of the manual I like:

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              |   
  • 2
    +1 dman is an extremely useful idea. – Sathyam Jan 27 '17 at 15:01

In my Opinion you can't read the documentation without installing the package. when you install any specific package you may have noticed some additional files also gets installed one of which is named as 'man-db' or something similar.

This 'man-db' actually contains the manual documentation about the package.

but you can see some basic details of the package by

apt-cache show <packagename>
  • 2
    The first part about man-db becomes relevant only after package installation (which OP doesn't want). – David Foerster Apr 4 '15 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.