2

Idk why, i cant update my gcc

root@server:~# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --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.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-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 --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.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)

try command

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9

have log:

root@server:~# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 Toolchain test builds; see https://wiki.ubuntu.com/ToolChain

 More info: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpi_ap8pke/secring.gpg' created
gpg: keyring `/tmp/tmpi_ap8pke/pubring.gpg' created
gpg: requesting key BA9EF27F from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpi_ap8pke/trustdb.gpg: trustdb created
gpg: key BA9EF27F: public key "Launchpad Toolchain builds" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
root@server:~# sudo apt-get update
Hit http://security.ubuntu.com trusty-security InRelease
Ign http://archive.ubuntu.com trusty InRelease
Ign http://archive.canonical.com trusty InRelease
Get:1 http://ppa.launchpad.net trusty InRelease [15.5 kB]
Get:2 http://security.ubuntu.com trusty-security/main amd64 Packages [493 kB]
Hit http://archive.ubuntu.com trusty-updates InRelease
Get:3 http://archive.canonical.com trusty Release.gpg [933 B]
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
root@server:~# sudo apt-get install g++-4.9
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package g++-4.9
E: Couldn't find any package by regex 'g++-4.9'
root@server:~#

Check again gcc ver.

root@server:~# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --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.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-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 --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.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
root@server:~#
L30m4nc3r
  • 21
  • 2
  • I don't think the package name will include the version. Please [edit] your question and post the output of `apt-cache show 'g++'`. Alternatively, just try `sudo apt-get install g++`. – terdon Jun 20 '16 at 18:36
  • @terdon my experience on 14.04 is that `apt-cache policy g++` will just show the standard repo version i.e. 4.8.x (because it's just a dependency package), whereas `apt-cache policy g++-4.9` should pick up the toolchain repo version. – steeldriver Jun 20 '16 at 18:48
  • Perhaps the catalog isn't getting updated at all because of the transport error (`method driver /usr/lib/apt/methods/https could not be found`)? – steeldriver Jun 20 '16 at 18:49
  • @steeldriver thanks. Now i fix this error, and apt-get update fix all errors. – L30m4nc3r Jun 20 '16 at 19:01
  • @steeldriver good catch! May as well post an answer. – terdon Jun 20 '16 at 20:49
  • This PPA does not have a `g++-4.9` package, only `gcc-4.9`. – fkraiem Jun 21 '16 at 13:10

1 Answers1

0

The toolchain repository requires https access, so because of the error

E: The method driver /usr/lib/apt/methods/https could not be found.

your package catalogue is not being updated even though you have successfully added the repository.

You can find some suggestions to fix the error at “method driver /usr/lib/apt/methods/https could not be found” update error - if you're lucky (meaning that plain http method is not also broken) it should be as simple as installing - or possibly reinstalling - the relevant package

sudo apt-get install apt-transport-https
steeldriver
  • 131,985
  • 21
  • 239
  • 326