Unable to locate package gcc-6 on Debian

6,700

As of 2020-02-08 gcc-6 is available as debian/strech package (oldstable).

https://packages.debian.org/search?keywords=gcc-6&searchon=names&suite=all&section=all

You may add oldstable to /etc/apt/sources.list.


https://wiki.debian.org/DebianOldStable

oldstable is a codename for the previous Debian stable repository, as long as security updates are provided. It is not just a name of the old stable version(s) of Debian.

Share:
6,700

Related videos on Youtube

peachykeen
Author by

peachykeen

Updated on September 18, 2022

Comments

  • peachykeen
    peachykeen over 1 year

    I am unable to install gcc-6 on Debian when I run sudo apt-get install gcc-6. It says E: Unable to locate package gcc-6.

    The lowest version gcc will go via apt-get is 7. Is there a special repository I need to setup in order to get older gcc verisons? I tried to build gcc-6 from source but struggled, so if that is the only way to get a working copy of gcc-6, it would be much appreciated if you could walk me through the steps or show me a solid resource for doing this.

    For reference, my system information is as follows:

    user@debian:~$ uname -a
    Linux debian 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
    

    The reason I am looking for an older gcc version is that I am trying to compile an older version of Linux (3.19) but I keep getting an error with newer gcc versions (7 & 8) stating:

    include/linux/compiler-gcc.h:106:1: fatal error: linux/compiler-gcc7.h: No such file or directory
    #include gcc_header(__GNUC__)
    ^~~~
    

    Thank you in advance for any help!

    • G-Man Says 'Reinstate Monica'
      G-Man Says 'Reinstate Monica' about 4 years
      If it’s saying ‘’compiler-gcc7.h: No such file or directory’’, I would question whether you have gcc-7 installed correctly.  Can you compile other things with it?
    • peachykeen
      peachykeen about 4 years
      The error I believe is arising because kernel v3.19 doesn't support gcc compilers beyond v5.
  • peachykeen
    peachykeen about 4 years
    So I added the two lines deb http://archive.debian.org/debian-archive/ oldstable main contrib non-free and deb-src http://archive.debian.org/debian-archive/ oldstable main contrib non-free to /etc/apt/sources.list but gcc-6 is still not found.
  • AnFi
    AnFi about 4 years
    Have you execute apt-get update after adding oldstable to sources.list? it is necessary to make apt-get install … see new available packages.
  • peachykeen
    peachykeen about 4 years
    That was the issue. Thank you!
  • hafiz031
    hafiz031 over 3 years
    @AnFi even after apt-get update it gives the same error on Ubuntu-20.04, I added the lines mentioned in peachykeen's comment.