This awk '$1 == "Package:" { if (a[$2]++ == 0) print $2; }' /var/lib/apt/lists/*ubuntu-toolchain-r*test*Packages > to_install.txt
will put all the packages into a text file.
You can manually edit this file to remove anything unwanted and use that file to feed it to apt-get
like for i in $(cat to_install.txt); do sudo apt-get install $i; done
. This last part will probably be a bad idea without confirming these packages are not conflicting with other packages in the PPA.
The normal way to do is write them out. So ...
sudo apt-get install gcc-5 g++-5 gfortran-5 gnat-5
after having a quick look at the packages to see if they might have conflicts.