How do I install gcc 6 (latest 6.1?) on Ubuntu 14.04 LTS, make c++14 the default and will my libraries work? Also, what problems can I expect if any? Lastly, please walk me through this because i am rather new at Linux and programming.
Asked
Active
Viewed 1.9k times
8
-
1This is not a duplicate. gcc 5 or 6 is not that easy to install into 14.04. – Pilot6 May 28 '16 at 07:35
-
@Pilot6: Worked like a charm here. – David Foerster May 28 '16 at 09:13
-
I saw that answer but struggled with dependencies. Maybe it is fixed in repositories now. – Pilot6 May 28 '16 at 09:46
1 Answers
5
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)