(此解决方案的开发部分基于N0rbert和我在他最初的建议中的对话)
对问题的理解发展到发现“ gpg”访问是有问题的/悬而未决的操作的地步。用户“ nobar”的评论对最终的线索很有帮助:
gpg: no valid OpenPGP data found.
In this scenario, the message is a cryptic way of telling you that the download failed.
看到那里讨论过的完整主题:https : //stackoverflow.com/questions/21338721/gpg-no-valid-openpgp-data-found
现在在这里解决该主题中的问题。
请访问http://keyserver.ubuntu.com/-对于每个缺少的密钥(BA9EF27F / F06FC659),请执行以下操作:
当上述操作完成两次(每个键一次)后,请运行此命令检查其是否有效:
apt update
结果中除应包含其他几行外,还应包含以下几行:
Get:23 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial/main Sources [13.4 kB]
Get:24 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial/main amd64 Packages [86.8 kB]
Get:25 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial/main i386 Packages [85.1 kB]
Get:27 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial/main Translation-en [14.4 kB]
Get:28 http://ppa.launchpad.net/jonathonf/gcc/ubuntu xenial/main Sources [12.1 kB]
Get:29 http://ppa.launchpad.net/jonathonf/gcc/ubuntu xenial/main amd64 Packages [79.7 kB]
Get:30 http://ppa.launchpad.net/jonathonf/gcc/ubuntu xenial/main i386 Packages [78.4 kB]
Get:31 http://ppa.launchpad.net/jonathonf/gcc/ubuntu xenial/main Translation-en [15.7 kB]
最后的操作是关于安装您选择的其他gcc版本:
apt install gcc-6 g++-6
apt install gcc-7 g++-7
apt install gcc-8 g++-8
apt install gcc-9 g++-9
这终于对我成功了。所有项目均从amd64存储库版本中的http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu获得 。我想如果我想在其他PPA上设置更高的优先级,则需要交换sources.list文件中的行。
到目前为止,检查已安装的gcc二进制文件的版本将返回以下文本:
# gcc-6 --version
gcc-6 (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# gcc-7 --version
gcc-7 (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# gcc-8 --version
gcc-8 (Ubuntu 8.3.0-16ubuntu3~16.04) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# gcc-9 --version
gcc-9 (Ubuntu 9.1.0-2ubuntu2~16.04) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
到目前为止,检查已安装的g ++二进制文件的版本将返回以下文本:
# g++-6 --version
g++-6 (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# g++-7 --version
g++-7 (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# g++-8 --version
g++-8 (Ubuntu 8.3.0-16ubuntu3~16.04) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# g++-9 --version
g++-9 (Ubuntu 9.1.0-2ubuntu2~16.04) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
更新:
这些命令(到目前为止)显然使用了Jonathon PPA:
# apt install clang
目前,该命令的版本如下:
$ clang --version
clang version 3.8.0-2ubuntu3~trusty5 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
# clang++ --version
clang version 3.8.0-2ubuntu3~trusty5 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin