How can I install gcc6.4, g++6.4 and cmake3 on Ubuntu 14.04? I want to rewrite below lines that run on Linux to be run on Ubuntu

$ yum install gcc64-c++ libcurl-devel
$ export CC=gcc64
$ export CXX=g++64
$ yum install cmake3

I tried below commands on ubuntu

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt update
$ sudo apt install -y g++-6
$ sudo apt install -y gcc-6
$ gcc --version
$ g++ --version
$ export CC=gcc6
$ export CXX=g++6
$ gcc --version
$ g++ --version

But version returned is

gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4


g++ (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 

Although I expect to be 6.4

And when I tried to install cmake3

 $ sudo apt-get update
 $ sudo apt purge cmake*
 $ wget http://www.cmake.org/files/v3.5/cmake-3.5.1.tar.gz
 $ tar xf cmake-3.5.1.tar.gz
 $ cd cmake-3.5.1
 $ ./configure
 $ make
 $ sudo make install
 $ cmake --version

It gave me an error in ./configure

CMake 3.5.1, Copyright 2000-2016 Kitware, Inc. 
Error when bootstrapping CMake: 
Cannot find appropriate C compiler on this system. 
Please specify one using environment variable CC. 
  • 1
    Instead of yum, use apt. Example: sudo apt install g++ – Elias Apr 10 '19 at 23:09
  • If you are familiar with yum, take a look at digitalocean.com/community/tutorials/… If you are lost, just search on that page for the correct yum command and you get the alternative of apt-get. – v010dya Apr 11 '19 at 5:17
  • 1
    Likely export CC=gcc6 and export CXX=g++6 should be export CC=gcc-6 and export CXX=g++-6 (check the actual names using ls /usr/bin/gcc*) – steeldriver Apr 11 '19 at 11:16
  • 2
    “Is there anyway to install cmake3.5 on Ubuntu 14.04.5 LTS ?” Yes, as I indicated, you should be able to simply run sudo apt install cmake3 to get CMake 3.5.1. – Melebius Apr 11 '19 at 11:30
  • 1
    I used Ubuntu 18 and its working. Thanks a lot for your support :) – Mohammed Hassan Apr 11 '19 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.