linuxapt-getlinux-mintgcc5

Install GCC5 in Linux Mint LMDE 2


I'm new in Linux and I would like to unistall gcc 4.9 which is installed in my distro Linux Mint LMDE 2 and install gcc 5. I tried to used the following command:

sudo apt-get install gcc5

but it didn't worked. Can someone please help me with this? Please provide all steps to follow. Thank you in advance


Solution

  • Try this.

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get update
    sudo apt-get install gcc-5 g++-5
    apt-get autoremove
    

    This should work in Linux Mint if I'm not mistaken, as its still using the same respository.

    sudo apt-get respository ppa:ubntu-toolchain-r/test
    

    This will install you the correct respositories you need for the computer. Some packages are not automatically known to the computer so you need to install the respositories so the computer can install it.

    sudo apt-get update
    

    This will update your computer and all packages and the respoitory, this wil ensure it will now work

    sudo apt-get install gcc-5 g++-5
    

    This will install the gcc-5 version you wanted.

    sudo apt-get autoremove
    

    When you install certain stuff, some things are no longer needed. Maybe a required package from a previous version that you no longer need, do this to conserve space.