0

I just install a kali-linux, and trying to play with it.

I did use ubuntu before. That cause some problems with different gcc version when I am trying to use some code what I build in my old Ubuntu.

I check the gcc -v; the kali give me gcc version 6.1.1 20160802(Debian 6.1.1-11) and ubuntu give me gcc version 5.4.0 20160609 (ubuntu 5.4.0-6ubuntu1~16.04.2)

I am not sure if my code doesn't compile because of this or not. But just want to check.

how can I remove Debian's gcc and switch to ubuntu one?

5
  • 1
    Better to try and fix your code. Use the newest compiler. Commented Sep 23, 2016 at 20:47
  • First you need to get rid of your current version: sudo apt-get purge gcc...then sudo apt-get install gcc-5.4 ;) Commented Sep 23, 2016 at 20:56
  • find real problem and fix code would spend more than two month I guess...... Commented Sep 23, 2016 at 21:06
  • 1
    @Hackman I did try to remove the old gcc, but when I try sudo apt-get install gcc-5.4 it unable to locate package gcc-5.4 are there any other name possible? Commented Sep 23, 2016 at 21:07
  • @dawenzi098 I have the same exact issue. Any solution anyone? Commented Jul 10, 2019 at 1:04

1 Answer 1

3

May be i'm not much familiar with debian. But with Ubuntu, i've followed this and changed the gcc version. May be this will help.
Change default gcc version

You can use this command to install gcc versions.

sudo apt-get install gcc-4.3 gcc-4.4 

Once installed, you have to update the alternatives with the variant gcc versions. Using

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 10 

You can choose which version of gcc, you can use by this command.

sudo update-alternatives --config gcc 
Sign up to request clarification or add additional context in comments.

1 Comment

How can I choose the alternative to switch to programmatically, like in a provisioning script?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.