Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
04-01-2017, 06:07 PM
|
#1
|
Member
Registered: Aug 2012
Posts: 789
Rep: 
|
How to uninstall gcc so I can start over?
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:~ $
How can I completely remove gcc and start over?
|
|
|
04-01-2017, 08:48 PM
|
#2
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
Depends on what broke.
To me, it looks like cmake aborted.
You might try the commands separately to see. You may need an update of cmake.
|
|
|
04-01-2017, 09:40 PM
|
#3
|
LQ Guru
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
|
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.
However, in saying all that, see http://unix.stackexchange.com/questi...ian-jessie-8-1
|
|
|
04-02-2017, 02:03 AM
|
#4
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
Try:
Code:
$ dpkg --purge --force-depends gcc
Then, read the man page for apt-get, so you can specify which branch of Debian to install from, i.e. stable, testing, sid.
Testing uses gcc6 which breaks a few things, like the kernel compile.
|
|
|
04-02-2017, 03:03 AM
|
#5
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
|
Quote:
Originally Posted by hydrurga
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.
|
|
|
04-02-2017, 04:49 AM
|
#6
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
$ sudo apt-get install build-essential
Perhaps you're missing things, which is why it fails.
The NOT best practices way, would be to change the /usr/bin/g?? links to some other version of gcc.
$ ls -l /usr/bin/g??
$ ls -l /usr/bin/gcc-*
$ sudo rm /usr/bin/gcc
$ sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
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.
|
|
|
All times are GMT -5. The time now is 01:22 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|