Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I seem to be missing some man pages, notably gcc and g++. It doesn't help that I specify the section. whereis doesn't list man pages for those two, so I think they are simply not there.

With Google I get a lot, for example: http://linux.die.net/man/1/g++ (seems to be ordinary HTML though... or is it man page markup?)

I thought this would be a good opportunity to learn how to replace them manually. I guess I'm looking for a gcc.1.gz file?

Do I get it from GNU, from Debian, or could it be automated somehow? How much work is put into those files - if I get one, is it likely to be 99% correct or do they really differ a lot with time/architecture?

share|improve this question
For gcc man pages, the package you want is gcc-doc. – jw013 Jul 6 '12 at 16:42
up vote 5 down vote accepted

You should add the non-free and contrib repositories to your sources list and run apt-get update afterwards.

Now you can install the gcc-doc package which contains the man-pages with:

apt-get install gcc-doc

The problem is that the gcc documentation is released under the GNU Free Documentation License which is considered non-free by Debian.

share|improve this answer
Yep, that did it. I guess they consider the compilers OK, because I can't recall installing them explicitly from any specific source. – Emanuel Berg Jul 6 '12 at 19:02

Many GNU projects, including GCC, license their documentation under the GNU Free Documentation License. There is a long-standing dispute between the Free Software Foundation and the Debian project, which considers the GFDL to be non-free, mostly because it can forbid some sections of the documentation from being modified.

For this reason, the GCC documentation is not included in the Debian distribution itself. It is, however, distributed by the Debian project as part of the “non-free” repository. That the non-free repository is officially supported by Debian but not officially part of Debian is the result of much debate and compromise inside the Debian project.

You can search on the Debian website for a package containing the file g++.1 (select “packages that contain files whose names contain the keyword”, because the man page is actually compressed so the file name is g++.1.gz). You'll find it in the gcc-VERSION-doc package, which is a meta-package in the contrib repository that depends on the gcc-VERSION-doc package in the non-free repository.

On your machine, make sure that you have the contrib and non-free repositories enabled. Your /etc/apt/sources.list should contain a line like

deb http://ftp.debian.org/debian squeeze main non-free contrib

or multiple lines like

deb http://ftp.debian.org/debian squeeze main
deb http://ftp.debian.org/debian squeeze contrib
deb http://ftp.debian.org/debian squeeze non-free

If you modify /etc/apt/sources.list, run apt-get update as root afterwards. Once you have these repositories in your sources, you can use apt-file to search for the package containing a file by name. You need to run apt-file update as root after installing the program or modifying the sources list.

apt-file search g++.1

Once you find what package the file you want is in (as indicated above, you want the g++-doc package), use apt-get install g++-doc or whatever your favorite package manager is.

share|improve this answer
Wow, apt-file is indeed very useful! – Emanuel Berg Jul 7 '12 at 17:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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