Where is the latest source code of man command for linux?

21,436

Solution 1

You can usually query your distribution to see where sources come from. For example, I'm on Fedora, and I can see that the man command comes from the man-db package:

$ rpm -qf /usr/bin/man
man-db-2.6.7.1-16.fc21.x86_64

I can then query the man-db package for the upstream url:

$ rpm -qi man-db | grep -i url
URL         : http://www.nongnu.org/man-db/

And there you are, http://www.nongnu.org/man-db/.

You can perform a similar sequence of steps with the packaging systems used on other distributions.

Solution 2

On Debian based distributions, same like Ubuntu, you can find and download source code like below:

$ which man
/usr/bin/man
$ dpkg --search /usr/bin/man
man-db: /usr/bin/man
$ apt-get source man-db

This will put the source code in your current working directory.

Share:
21,436

Related videos on Youtube

CodyChan
Author by

CodyChan

Updated on September 18, 2022

Comments

  • CodyChan
    CodyChan over 1 year

    I'm looking for the latest source code of man command, the version in my Linux is pretty old(v1.6f), but I failed after googling a while.

    I mean the latest source code of man, not man-pages but the binary file in /usr/bin/man itself which can be compiled and installed.

  • CodyChan
    CodyChan over 8 years
    Thanks, I've already got man-db after I posted this question, it seems I cannot just compile man from the source code because of many dependencies.
  • fpmurphy
    fpmurphy over 8 years
    That is true. You are going to have to resolve all the dependencies first. even then, your new man binary may not be useful to you because of dependencies on other newer binaries.
  • schily
    schily over 8 years
    If there are only linear dependencies, this is easy ;-) There are program systems line GNOME that have circular dependencies. I hope that some OSS developers learn to create sources with documented linear dependencies only.
  • Stéphane Chazelas
    Stéphane Chazelas over 8 years
    If rpm -qf or dpkg -S or the equivalent for your packaging system for `"$(command -v man)" returns the name of a package, then that method is going to be a lot more reliable than googling for strings found in the binary though. Bear in mind that most distributions patch the software from upstream. So the source package for your distribution is the only place to go for the exact source code as compiled for your /usr/bin/man.
  • schily
    schily over 8 years
    There are more than a dozen different packaging systems, so you would need to mention many methods..... but you are correct: In general, many distributions are non-collaborative and either patch bugs into the software or do not report useful patches upstream.
  • Tim
    Tim over 6 years
    For future reference, on Debian based distributions the equivalent commands are dpkg -S /usr/bin/man and apt-cache show man-db | grep Homepage
  • Aaron Hall
    Aaron Hall almost 6 years
    Thanks, this helped me. Would be nice if this answer could be somehow more generalized.