UbuntuにGCC 7をインストールしますか?

UbuntuにGCC 7をインストールしますか?

GCC 7でテストを実行しようとしています。 ~によるとgcc-7またはclang 4.0をインストールする方法は?Ubuntu.SEでは、次のようにしてUbuntuにGCC 7をインストールできます。

add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update && apt-get install -y gcc-7

インストール時にコマンドが失敗します。

# apt-get install -y gcc-7
...
E: Unable to locate package gcc-7

7.1を試してください。

# apt-get install -y gcc-7.1
...
E: Unable to locate package gcc-7.1
E: Couldn't find any package by glob 'gcc-7.1'
E: Couldn't find any package by regex 'gcc-7.1'

~によるとUbuntu / Debianリポジトリのすべてのパッケージを一覧表示サーバーエラーが発生した場合は、以下を使用して特定のリポジトリからパッケージを検索できます。

# grep ^Package: /var/lib/apt/lists/ppa.launchpad.net_*_Packages | grep gcc-7
#

しかし、上記のコマンドが検索されているかどうかはわかりませんppa:ubuntu-toolchain-r

いくつかを一緒に投げましたが、期待どおりに動作しません。 Ubuntu.SEの答えが間違っているか、サーバーエラーの検出に失敗したか、私が何か間違っています。

(私はDebain 8マシンを使用できません。gcc-7パッケージ、Fedora 25にはGCC 7がありません。だから私はほとんどUbuntuだけを使います。)

私は何が間違っていましたか?それともGCC 7をインストールする方法は?


# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.10
Release:        16.10
Codename:       yakkety

ベストアンサー1

Ubuntuにインストールするにはgcc-7これを使用する必要がありますポリアニリン:

sudo add-apt-repository ppa:jonathonf/gcc
sudo apt-get update

次に、次を実行します。apt-cache search gcc-7

サンプル出力:

gcc-7-base - GCC, the GNU Compiler Collection (base package)
gcc-7 - GNU C compiler
gcc-7-multilib - GNU C compiler (multilib support)
gcc-7-plugin-dev - Files for GNU GCC plugin development.
gcc-7-test-results - Test results for the GCC test suite
lib32gcc-7-dev - GCC support library (32 bit development files)
libgcc-7-dev - GCC support library (development files)
gcc-7-doc - Documentation for the GNU compilers (gcc, gobjc, g++)
gcc-7-hppa64-linux-gnu - GNU C compiler (cross compiler for hppa64)
gcc-7-locales - GCC, the GNU compiler collection (native language support files)
gcc-7-source - Source of the GNU Compiler Collection
libx32gcc-7-dev - GCC support library (x32 development files)
gcc-7-offload-nvptx - GCC offloading compiler to NVPTX
lib64gcc-7-dev - GCC support library (64bit development files)

インストールするgcc-7

sudo apt install gcc-7

おすすめ記事