Debian – Why can’t I fetch the gcc-doc package on Debian

aptdebiandocumentationgccrepository

When I was testing some code snippets from Stack Overflow, I realized that I haven't any man-pages for GCC on my Debian System. But when I try to get them from Debian's repositories it outputs E: unable to fetch gcc-doc4.3.

How can I get that package, and why this package isn't include with gcc altogether?.

Best Answer

Get gcc-doc package

In order to be able to fetch this packages with the apt-get install command we need to edit our sources.list file to include both contrib and non-free repositories.

For example, here's my /etc/apt/sources.list file:

deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

# jessie-updates, previously known as 'volatile'
deb http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie-updates main contrib non-free

# Backport Testing on stable
# JDK 8
deb http://ftp.de.debian.org/debian jessie-backports main

Note: in case someone doesn't know it yet, in normal circumstances this file can only be edited as root.

$ su
[YOUR_ROOT_PASSWORD]
# vi /etc/apt/sources.list

or you can use an editor which is more newbie-friendly, like Nano

# nano /etc/apt/sources.list

or a GUI editor, like Gedit

# gksu gedit /etc/apt/sources.list

Be sure to add both contrib and non-free resositories. In my case, gcc-4.9-doc all was in the non-free repo, while gcc-doc amd64 was located at contrib repo.

Why is gcc-doc non-free?

Because of issues between the GFDL (GNU Free Documentation License) and the DFSG (Debian Free Software Guidelines), yup, more blessed legalities.

Here's two core incompatibilities:

  • GFDL licensed documents are prohibited to be used on any project that uses DRM (Digital Rights Management), Debian don't allow such restrictive behavior in software/documents to consider them free.

  • Documents licenced as GFDL are allowed to contain invariant sections. To Debian, that is simply not an example of free content, whether this content is software or documentation.

For more, read this Position Statement.