在Mint 17.2上安装g ++ 4.9

时间:2015-11-01 00:58:08

标签: c++ linux gcc install g++4.9

我正在尝试安装g ++ 4.9或更高版本,以便在Android上构建mapbox。说明指出我需要g ++ 4.9或更高版本。我找到了以下说明,但他们没有工作。

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

最后一个命令说:

~ $ sudo apt-get install g++-4.9
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package g++-4.9 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'g++-4.9' has no installation candidate

我也尝试从Synaptic Package Manager获得以下内容:

g++:
  Depends: cpp (>=4:4.9-1ubuntu7) but 4:4.8.2-1ubuntu6 is to be installed
  Depends: gcc (>=4:4.9-1ubuntu7) but 4:4.8.2-1ubuntu6 is to be installed
 Depends: g++-4.9 (>=4.9) but it is not installable
 Depends: gcc-4.9 (>=4.9) but it is not installable

如何在我的电脑上安装g ++ 4.9?

感谢。

1 个答案:

答案 0 :(得分:6)

以下是如何在Linux Mint上安装g ++ - 4.9 17.2 Rafaela

  1. 转到菜单 - >管理 - >软件来源

  2. 点击其他存储库,然后点击 Getdeb

  3. 点击编辑网址...

  4. 替换 deb http://archive.getdeb.net/ubuntu trusty-getdeb apps

    通过

    deb http://archive.getdeb.net/ubuntu wily-getdeb apps

    并点击更新缓存

  5. enter image description here

    1. 此时你可以选择

        

      sudo add-apt-repository ppa:ubuntu-toolchain -r / test

           

      sudo apt-get update

           

      sudo apt-get install g ++ - 4.9

    2. enter image description here

      你可以像这样调用你的g ++:

        

      克++ - 4.9

      enter image description here

      现在你安装了g ++ 4.9.3

      作为补充,您可以使用最新的g ++ - 5(g ++ 5.2.1)编译器

        

      sudo apt-get install g ++ - 5

      enter image description here