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.
dman
Retrieves Manual PagesIn 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 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.
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)
NAME
sl - display animations aimed to correct users who accidentally enter
sl instead of ls.
SYNOPSIS
sl [ -alFe ]
DESCRIPTION
sl Displays animations....
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 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 |
http://manpages.ubuntu.com/
bikeshed
, you can install debian-goodies
which will give you both dman
and debman
debman
which is part of the debian-goodies
package you can use debman -p debian-goodies debman
. If you have a .deb
package on your computer you can use -f
option to view manpages of it without installing that package: debman -f debian-goodies_0.79_all.deb debman
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>
apt-cache search
and it's easier to scroll through the results. Alternatively, apt search
has highlighted package names in green, the descriptions are tabbed (hanging indent like MLA citations) with a line space in between each result. Apt also shows version and architecture but the green highlighting makes it hard to discern where the list begins if you run more than one list when your username@server is also green and not as easy as piping awk '{print $1}'
to parse a list of packages.
apt
might be more friendly, but is not oriented to use with pipes (grep -A/-B 1
options might be handy) or in scripts. As man states: All features of apt
are available in dedicated APT tools like apt-get
and apt-cache
as well. apt
just changes the default value of some options. So you should prefer using these commands (potentially with some additional options enabled) in your scripts as they keep backward compatibility as much as possible.
May 7, 2023 at 23:49
I recommend installing debian-goodies
package which will give you access to the dman
, debman
, debmany
, and debget
commands, and many more. Install it with:
sudo apt install debian-goodies
dman
has already been covered by Eliah Kagan.
Now you know dman
is both included in bikeshed
and debian-goodies
.
You can use debman to read man pages from uninstalled (not installed) packages.
In these examples I want to read the man page of dman
from package debian-goodies
:
debman -p debian-goodies dman
Or if you're looking to read man pages for a specific version, use:
debman -p debian-goodies=0.79 dman
You can also read local .deb
files' manpage using the -f
option:
debman -f debian-goodies_0.79_all.deb dman
Just for clarity, here's another example, I want to read the man page of apt-get
tool which belongs to the apt
package:
debman -p apt apt-get
So you need to know the command which you want to read it's man page belongs to which package.
You can download packages with debget
and read them manually with your favorite app:
debget debian-goodies
man pages and other documentation are included in .deb
packages, they can be found in:
debian-goodies_0.79_all.deb\data.tar\usr\share\man
debian-goodies_0.79_all.deb\data.tar\usr\share\doc
Or you can use debmany
to view all documentation using terminal:
debmany ./debian-goodies_0.79_all.deb
You can also use it for installed packages:
debmany debian-goodies
When I'm on my android phone and sometimes even when I'm on Ubuntu I will use internet to view man pages. Another benefit of internet browser is ability to easily search with Ctrl+F. In your browser search bar you can type man ls
and this is the first hit:
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>
man-db
becomes relevant only after package installation (which OP doesn't want).
Apr 4, 2015 at 18:37