6

I wanted to see gcc's maual but

$ man gcc
No manual entry for gcc
See 'man 7 undocumented' for help when manual pages are not available.
$ man gcc-XX
No manual entry for gcc-XX
$sudo nano /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free$
#deb http://apt.adafruit.com/raspbian/ stretch main
$ sudo apt-get update
$ sudo apt-get --reinstall install man gcc
$ man gcc
#same as above

Where's the problem? Should i change sources.list.d/raspi.list?

1 Answer 1

7

The documentation for GCC is actually contained in its own package1, gcc-doc.

Just run:

sudo apt-get install gcc-doc

and then man gcc will work as expected.

Note that your attempt, sudo apt-get --reinstall install man gcc asks apt-get to try and install two packages, man and gcc. man doesn't exist as a package in the repositories, and gcc will just be reinstalled as you've asked, but it won't find the manual for GCC doing that. You cannot use apt-get in that way, unfortunately.


1 gcc-doc is actually a metapackage which just depends on the relevant version of the docs (e.g. gcc-6-doc for Stretch, gcc-4.9-doc for Jessie, etc). This means that you should get the right version of the docs by default, although you can also verify that the version is correct as described by joan below.

4
  • 2
    You probably need to get a package against the gcc version, e.g. gcc-6-doc if gcc -v reports you are using version 6.
    – joan
    Commented Aug 30, 2018 at 14:36
  • sorry if i'm bad, it's my first question here. Sorry!
    – SuperPizz
    Commented Sep 4, 2018 at 12:34
  • i installed gcc-6-doc and run man gcc and it worked!
    – SuperPizz
    Commented Sep 4, 2018 at 12:47
  • Rather random, somewhat sketchy Raspbian (Debian 10.2.0 Buster released 2019 November 16 Saturday) has gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1) yet "no installation candidate" for gcc-doc and gcc-8-doc but apt-get install 'gcc*doc' reveals that `apt-get install gcc-7-doc' works.
    – Devon
    Commented Dec 27, 2019 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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