How do I install gcc 6 (latest 6.1?) on Ubuntu 14.04 LTS, make c++14 the default and will my libraries work? [duplicate]
Solution 1:
You can add a repository that contains the latest GCC and then simply install it via sudo apt install gcc
(I've provided a link). Alternatively, you can build the latest GCC from source (this is just an example, read the README
and INSTALL
file):
$> # download the latest gcc tar file and extract
$> ./configure
$> make
$> sudo make altinstall
Ramifications
If you're just playing around with a system and/or Ubuntu is running in a VM (Virtualbox, VMWare, QEMU, etc) then the side effects are negligible and you probably won't care. However if you're on some sort of production server that "needs to always work" than you might run into issues that require a certain version of GCC. In this case, you should make an alternative install (ie. make altinstall
) when building from source or use a verified package.
Links
- Install GCC 6 on Xenial
- Install latest gcc on Ubuntu (this is old, but has a good example of how to build from source)