I want to install G++ 14.1 on Ubuntu 24.04. I have 14.0 installed, but 14.1 fixes some bugs.
I don't want to build from source. I did a cross compiler build a few years ago and it kept crashing my machine and I don't have a wimpy machine.
You can install it using the following command:
$ apt-get install g++-14
Note that one way to find a package name is to search the cache like so:
$ apt-cache search g++ | less
Once you get output in less, you can search using the / key and then typing a pattern, which in this case would be 14 and hit enter. To search for the next instance, use the n key.
Once installed, you can use it with:
$ /usr/bin/g++-14 ...
If you want to make it your default compiler and be able to switch between different versions, you probably want to look at the alternative setup found in this question: