Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
Hello, I was always under the impression that you shouldn't remove GCC, since it would break much of the OS. Is this assumption wrong? Can GCC be safely removed? Thanks ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Location
    Salem, Ma
    Posts
    6

    Can you safely remove GCC


    Hello, I was always under the impression that you shouldn't remove GCC, since it would break much of the OS.

    Is this assumption wrong?

    Can GCC be safely removed?

    Thanks for any help,
    Allen

  2. #2
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    You should be able to remove gcc without breaking the existing system.
    Not sure why you would want to remove it, though, since it may be needed for later updates or patches.
    Last edited by jayd512; 01-20-2012 at 12:40 AM. Reason: underlined 'existing'
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  3. #3
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    I would not do that but if you do, please let us know how it goes. Sounds kinda wack.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    The way I see it, you can safely remove ANY package from a system, provided that you use that system's package manager to remove it. This presumes that you do not have any 3rd party or manual software installed that depends upon this software.

    For example, I could remove gcc from my Fedora box:

    Code:
    rpm -e gcc
    but it would fail b/c gcc-c++ package relies upon it. well, that's no big deal, i'd just remove them both:

    Code:
    rpm -e gcc gcc-c++
    Although, you should really use yum to remove packages, if you use yum to install them.

    (btw, you can force packages to be removed that complain about dependencies that you don't want to remove by using the --nodeps switch to rpm, but that is when you will start breaking your system)


    The point is, you can always use the package manager to reinstall those same packages again, either the exact same versions, or updated versions of them. If there are config files that are owned by those packages, they are typically not removed by the package manager upon removal of the package. E.g. the config file /etc/vsfptd.conf for the vsftpd FTP daemon will get saved - if you modified it - and not removed, and when a new package is installed, that config file will not be overwritten.

    Also, with rpm, you can do a dry run of erasing the package, to see what it would do:
    Code:
    rpm -e --test gcc gcc-c++
    I'm sure there are similar test options for other package managers.

    As to gcc itself, I don't see how that would break any packages, unless they were compiling packages that depended on gcc. You can typically query the package manager to see what package dependencies a particular package has, e.g.:

    Code:
    rpm -q gcc --requires
    It will display a list of files and package names (and sometimes esoteric "things" that are neither but are provided by some other package). This is may be an unwieldy list of things, but it will give you more information about the package. Again, I'm sure other package managers provide similar capabilities.

  5. #5
    Just Joined!
    Join Date
    Sep 2010
    Location
    Salem, Ma
    Posts
    6
    Quote Originally Posted by MikeTbob View Post
    I would not do that but if you do, please let us know how it goes. Sounds kinda wack.
    I agree, it does sound wacked, however, our prime has delivered us a product that they "somehow" built using gcc 4.5 on RHEL 6?!?! Now I can not get it to install on my RHEL 6.1 system due to dependencies on libstdc++, since mine is 4.4.6.

    They suggest removing gcc-g++ and installing a libstdc++ rpm from FC14, but I'm not keen on this idea. So I thought that I could build gcc 4.5 on my own but I would want to install it in the default system space. This lead me to believe, either correctly or incorrectly, that I would have to first remove gcc 4.4 just to keep everything clean.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,444
    You can install more than one version of the gnu compiler tools on a system. I have 3.x, 4.4, and 4.5 on mine.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Isn't there also a GCC backward compatible package?
    Last edited by MikeTbob; 01-20-2012 at 08:25 PM. Reason: clarification
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,444
    Yes. On newer systems that would be 3.4. On Red Hat 5 systems that was 2.95 I think. I think that 3.4 has a 2.95 mode in order to build REALLY old code.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by violentwind View Post
    They suggest removing gcc-g++ and installing a libstdc++ rpm from FC14, but I'm not keen on this idea.
    I agree w/you, this is a horrible idea. They should give you the source RPM and allow you to rebuild it on your system. Or if they don't want to do that, they should build it for you on a RHEL6.x system of theirs and give you the resultant binary.

    Quote Originally Posted by violentwind View Post
    So I thought that I could build gcc 4.5 on my own but I would want to install it in the default system space. This lead me to believe, either correctly or incorrectly, that I would have to first remove gcc 4.4 just to keep everything clean.
    You could make your own RPM of gcc version 4.5, using the RHEL spec file from gcc-4.4 and the stock gcc 4.5 source. Then you could use yum/rpm to upgrade your gcc 4.4 to 4.5 cleanly (ish).

    It would probably be quicker to first try and install gcc 4.5 to an alternate location (like /opt or /usr/local) like has been suggested, and see if the customer RPM will then install. If that doesn't work, then maybe you'll have to roll your own RPM.

    But my preferred solution would be to have the SRPM itself or have it rebuilt for your platform.

  10. #10
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    Quote Originally Posted by atreyu View Post
    The way I see it, you can safely remove ANY package from a system, provided that you use that system's package manager to remove it.
    A package manager will manage packages for you ... it won't stop you destroying your system ! the package manager is also a package which can be removed ... just because you can doesn't mean you should

    You are the system administrator ... not the package manager ...

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •