![在 ubuntu 22.04 中安装 GCC (G++) 5 时出现问题](https://linux22.com/image/1208129/%E5%9C%A8%20ubuntu%2022.04%20%E4%B8%AD%E5%AE%89%E8%A3%85%20GCC%20(G%2B%2B)%205%20%E6%97%B6%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98.png)
我的 ubuntu 22.04 上需要 gcc 5。我尝试使用“sudo apt-get install gcc-5 g++-5”,但出现了以下输出:
sudo apt-get install gcc-5 g++5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'librust-encoding-rs-0+fast-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'librust-encoding-rs+less-slow-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'libonig5' for regex 'g++5'
Note, selecting 'libini-config5' for regex 'g++5'
Note, selecting 'libsuitesparseconfig5' for regex 'g++5'
Note, selecting 'libkf5plotting5' for regex 'g++5'
Note, selecting 'libqt5positioning5' for regex 'g++5'
Note, selecting 'librlog5v5' for regex 'g++5'
Note, selecting 'libkf5notifyconfig5' for regex 'g++5'
Note, selecting 'libapt-pkg5.0' for regex 'g++5'
Note, selecting 'qtpositioning5-examples' for regex 'g++5'
Note, selecting 'librust-encoding-rs-0.8+less-slow-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'liboxygenstyleconfig5-5' for regex 'g++5'
Note, selecting 'librust-encoding-rs-0.8.22+less-slow-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'librust-encoding-rs-0.8.22+fast-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'libnanomsg5' for regex 'g++5'
Note, selecting 'liballegro-dialog5.2' for regex 'g++5'
Note, selecting 'libinotify-ocaml-dev-zqg59' for regex 'g++5'
Note, selecting 'libkf5syntaxhighlighting5' for regex 'g++5'
Note, selecting 'qtpositioning5-dev' for regex 'g++5'
Note, selecting 'qtpositioning5-doc' for regex 'g++5'
Note, selecting 'qtsvg5-doc-html' for regex 'g++5'
Note, selecting 'libqt5svg5' for regex 'g++5'
Note, selecting 'qtsvg5-doc' for regex 'g++5'
Note, selecting 'qtpositioning5-doc-html' for regex 'g++5'
Note, selecting 'libkf5akonadisearchdebug5' for regex 'g++5'
Note, selecting 'librust-encoding-rs+fast-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'liballegro-dialog5-dev' for regex 'g++5'
Note, selecting 'libqt5svg5-dev' for regex 'g++5'
Note, selecting 'libroot-montecarlo-eg5.34' for regex 'g++5'
Note, selecting 'libinotify-ocaml-zqg59' for regex 'g++5'
Note, selecting 'librlog5' for regex 'g++5'
Note, selecting 'libipmimonitoring5a' for regex 'g++5'
Note, selecting 'libqt5positioning5-plugins' for regex 'g++5'
Note, selecting 'librust-encoding-rs-0.8+fast-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'qtsvg5-examples' for regex 'g++5'
Note, selecting 'librust-encoding-rs-0+less-slow-big5-hanzi-encode-dev' for regex 'g++5'
Note, selecting 'libinotify-ocaml' instead of 'libinotify-ocaml-zqg59'
Note, selecting 'libinotify-ocaml-dev' instead of 'libinotify-ocaml-dev-zqg59'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs+fast-big5-hanzi-encode-dev'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs+less-slow-big5-hanzi-encode-dev'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs-0+fast-big5-hanzi-encode-dev'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs-0+less-slow-big5-hanzi-encode-dev'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs-0.8+fast-big5-hanzi-encode-dev'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs-0.8+less-slow-big5-hanzi-encode-dev'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs-0.8.22+fast-big5-hanzi-encode-dev'
Note, selecting 'librust-encoding-rs-dev' instead of 'librust-encoding-rs-0.8.22+less-slow-big5-hanzi-encode-dev'
E: Unable to locate package gcc-5
现在最后一行表示什么...有什么解决办法吗?我已经使用“sudo add-apt-repository ppa:ubuntu-toolchain-r/test”添加了存储库,并执行了 sudo update。它仍然显示相同的结果。