Saturday, November 19, 2016

apt - Man page based on package name?




I have a script that gets man pages based on a package name. Most of the time this works:



...
# get program description for each
xargs man -f | grep \(1\) | sed 's/(1)//g' |
...


I'm looking for a solution that will also work with packages that have man pages which aren't located under the package name.




For example if my list of packages to install includes python-pip, which requires man pip.



Thus I need to either automated getting the command e.g. pip from python-pip, but a solution that works for all cases. Or some how get a man page via package name directly.



To get manpages from a package, check the list of files for files in /usr/share/man:



$ dpkg -L python-pip | grep 'man[0-8].*/'
/usr/share/man/man1/pip.1.gz
/usr/share/man/man1/pip2.1.gz

$ dpkg -L deja-dup | grep 'man[0-8].*/'
/usr/share/man/az/man1/deja-dup-preferences.1.gz
/usr/share/man/az/man1/deja-dup.1.gz
/usr/share/man/lv/man1/deja-dup-preferences.1.gz
/usr/share/man/lv/man1/deja-dup.1.gz
/usr/share/man/sr/man1/deja-dup-preferences.1.gz

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...