LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 04-01-2017, 06:07 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
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?
 
Old 04-01-2017, 08:48 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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.
 
Old 04-01-2017, 09:40 PM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926
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
 
Old 04-02-2017, 02:03 AM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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.
 
Old 04-02-2017, 03:03 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
Blog Entries: 21

Rep: Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787Reputation: 4787
Quote:
Originally Posted by hydrurga View Post
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.
 
Old 04-02-2017, 04:49 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
$ 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc uninstall binary DebianUser Linux - Software 1 05-28-2014 01:11 PM
Uninstall - a clean start Alex_Uconomy Debian 3 05-04-2011 06:37 AM
how can i uninstall gcc-3.3-base biosedit Linux - Software 2 11-11-2005 01:57 AM
need to uninstall gcc 2.96 then install newer? ginda Linux - General 3 07-17-2005 03:16 PM
Install/ UnInstall GCC hatti_ajit Linux - Newbie 3 07-19-2004 03:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration