I needed gcc 5 on my ubuntu 22.04. I tried using "sudo apt-get install gcc-5 g++-5" but this output is coming:
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
Now what does last line indicate ...any solution. I have already added the repository using "sudo add-apt-repository ppa:ubuntu-toolchain-r/test" and have done sudo update.
It still is showing same result.