Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to upgrade to gcc5 on a rasperry pi. I tried the following:
Code:
sudo apt update
sudo apt upgrade
sudo vi /etc/apt/sources.list #change “jessie” to “stretch”
sudo apt update
sudo apt install gcc-5
But now I am getting some strage "Segmentation fault"
Code:
michael@raspberrypi3:~/testclient/build $ cmake -DCMAKE_BUILD_TYPE=Release ../ && make
Segmentation fault
michael@raspberrypi3:
Furthermore, it seems like I went past gcc5 all the way to 6.
Code:
michael@raspberrypi3:~ $ gcc --version
gcc (Raspbian 6.3.0-10+rpi1) 6.3.0 20170321
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
michael@raspberrypi3:~ $
When a distro puts a version together, they pay attention to trying to ensure that everything works together. The system components, of which gcc is one, are part of that intricate web.
So personally, and others may disagree with me, I would have been reticent in the first place to update only gcc and no other system components. If I wanted a more up-to-date version of gcc for a particular purpose, especially with a different major version number, then I would install a separate gcc version in addition to my current one (see http://gcc.gnu.org/faq.html#multiple), keeping the current one to handle everyday system compilations.
However, even then, I would probably prefer to upgrade the entire system version to one more closely matched with the new gcc version.
Uninstalling gcc? It will probably remove several packages with it. You might be better changing the sources list back and then forcing a downgrade. That might cause unintended complications however. Personally I would have made a system image before mucking around with gcc so that I could easily roll back to a previous image if things went awry.
So personally, and others may disagree with me, I would have been reticent in the first place to update only gcc and no other system components. If I wanted a more up-to-date version of gcc for a particular purpose, especially with a different major version number, then I would install a separate gcc version in addition to my current one (see http://gcc.gnu.org/faq.html#multiple), keeping the current one to handle everyday system compilations.
In LFS, gcc is one of the things that you never update. The others are binutils, glibc and the kernel headers against which glibc was built.
And such. The way you're supposed to do that is with the package management system. Or by overriding environment variables CC, CXX, ... ... ... But not all build configurations are portable enough to respect the environment vars.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.