0

I'm afraid my gcc package is not being updated (version 4.9.3 on Xubuntu 16.04). My guess is someone else or myself might have mistakenly configured it to hold itself back, but I don't know who to release that lock.

I know it doesn't appear to be locked in the synaptic package manager interface, so it must have been done some other way.

Could you guys help me figure this one out? What are other ways to install and keep out-of-date packages?

Output of gcc -v (all that long "Configured with" line looks suspicious but I don't really understand it)

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.3-13ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.3 (Ubuntu 4.9.3-13ubuntu2)

EDIT:

apt-mark showhold has no output (empty)

grep "^deb " /etc/apt/sources.list output:

deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main 
restricted
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main 
restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main 
restricted
deb http://us.archive.ubuntu.com/ubuntu/ xenial-security universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial-security multiverse

apt-cache policy gcc output:

gcc:
  Installed: 4:5.3.1-1ubuntu1
  Candidate: 4:5.3.1-1ubuntu1
  Version table:
 *** 4:5.3.1-1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

which gcc: /usr/bin/gcc

whereis gcc:

gcc: /usr/bin/gcc /usr/lib/gcc /usr/share/man/man1/gcc.1.gz

/usr/bin/gcc -v |& tail -1 (I don't get how this one contradicts the others, what's the explanation?)

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

update-alternatives --list gcc:

/usr/bin/gcc-4.9
/usr/bin/gcc-5
Oded Sayar
  • 405
  • 1
  • 5
  • 14
  • 1
    Possible duplicate of ["The following packages have been kept back:" Why and how do I solve it?](https://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it) – George Udosen Jul 05 '17 at 19:07
  • `apt-get install gcc` or `dpkg -i gcc` should remove the hld if there is one. of course installing the new version will also fix it – ravery Jul 05 '17 at 19:08
  • 1
    Please edit your question and add the output of these two command: `apt-mark showhold` and `grep "^deb " /etc/apt/sources.list`. – Ravexina Jul 05 '17 at 19:08
  • Not a duplicate since `gcc` doesn't appear on the `dist-upgrade`. reinstalling `gcc` also doesn't help – Oded Sayar Jul 05 '17 at 19:18
  • 1
    @OdedSayar can you add the output of `apt-cache policy gcc` too? – Ravexina Jul 05 '17 at 19:23
  • You've got the last version installed... what is the output of `which gcc`? and `whereis gcc` ? – Ravexina Jul 05 '17 at 19:28
  • Also `/usr/bin/gcc -v |& tail -1` – Ravexina Jul 05 '17 at 19:29
  • 1
    Please check the output of `update-alternatives --list gcc` – Charles Green Jul 05 '17 at 19:38
  • so how come the regular `gcc` gives me the 4.9 while I have the updated 5.4? – Oded Sayar Jul 05 '17 at 19:43
  • It's a little bit weird... cause `which` returns the correct path, I let you know if I came up with something new. – Ravexina Jul 05 '17 at 19:50
  • I mean, I solved it by `sudo update-alterantives --config gcc` and choosing the 5.4, but I wonder how it got to be the default – Oded Sayar Jul 05 '17 at 19:55
  • 1
    If you solved your problem yourself, please [answer your own question](/help/self-answer) and accept your answer. Don’t put the answer in your question or the comments! Send me a message in the comments if you want my up-vote. :-) – David Foerster Jul 06 '17 at 09:09

1 Answers1

1

As OP found out themselves

sudo update-alterantives --config gcc

allowed them to choose a different default gcc version.

David Foerster
  • 35,754
  • 55
  • 92
  • 145