Updating gcc ubuntu

sudo apt-get update sudo apt-get install gcc-4.6 sudo apt-get install g -4.6 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20 sudo update-alternatives --install /usr/bin/g g /usr/bin/g -4.6 20 sudo update-alternatives --config gcc sudo update-alternatives --config g is the general procedure.Read the options in the configure script..have to have a version installed to compile a new one.

updating gcc ubuntu-53

Depends: cpp-6 (= 6.1.1-2ubuntu12~16.04) but it is not going to be installed Depends: gcc-6-base (= 6.1.1-2ubuntu12~16.04) but 6.1.1-3ubuntu11~14.04.1 is to be installed Depends: libgcc-6-dev (= 6.1.1-2ubuntu12~16.04) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

sudo apt-get update && \ sudo apt-get install build-essential software-properties-common -y && \ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ sudo apt-get update && \ sudo apt-get install gcc-snapshot -y && \ sudo apt-get update && \ sudo apt-get install gcc-6 g -6 -y && \ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g g /usr/bin/g -6 && \ sudo apt-get install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update && sudo apt-get install gcc-snapshot -y && sudo apt-get update && sudo apt-get install gcc-6 g -6 -y && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g g /usr/bin/g -6 && -sudo apt-get install gcc-4.8 g -4.8 -y && -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g g /usr/bin/g -4.8; Hit:1 xenial In Release Ign:2 xenial-updates/newton In Release Hit:3 xenial In Release Hit:4 xenial In Release Hit:5 xenial-updates/newton Release Get:7 xenial-security In Release [102 k B] Get:8 xenial-updates In Release [102 k B] Get:9 xenial-backports In Release [102 k B] Fetched 306 k B in 1s (199 k B/s) Reading package lists... Done Building dependency tree Reading state information...

Done build-essential is already the newest version (12.1ubuntu2). software-properties-common is already the newest version (0.96.20.4).

You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: cpp-5 : Depends: gcc-5-base (= 5.4.0-6ubuntu1 Toolchain ppa updates to gcc-7.1 on 16.04 Xenial.

Error Banner.fade_out.modal_overlay.modal_overlay .modal_wrapper.modal_overlay [email protected](max-width:630px)@media(max-width:630px).modal_overlay .modal_fixed_close.modal_overlay .modal_fixed_close:before.modal_overlay .modal_fixed_close:before.modal_overlay .modal_fixed_close:before.modal_overlay .modal_fixed_close:hover:before.

Selector .selector_input_interaction .selector_input. Selector .selector_input_interaction .selector_spinner.

package contains an informational list of packages which are considered essential for building Ubuntu packages including gcc compiler, make and other required tools.

This package also depends on the packages on that list, to make it easy to have the build-essential packages installed.

Done E: Unable to locate package gcc-6.2 E: Couldn't find any package by glob 'gcc-6.2' E: Couldn't find any package by regex 'gcc-6.2' E: Unable to locate package g -6.2 E: Couldn't find any package by glob 'g -6.2' E: Couldn't find any package by regex 'g -6.2' sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5.3 10 sudo update-alternatives --install /usr/bin/g g /usr/bin/g -5.3 10 sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 sudo update-alternatives --set cc /usr/bin/gcc sudo update-alternatives --install /usr/bin/c c /usr/bin/g 30 sudo update-alternatives --set c /usr/bin/g sudo update-alternatives --config gcc sudo update-alternatives --config g Sorry this ended up quite long and please let me know if you need more info. EDIT: I actually got it to work by changing gcc-5.3 to gcc-5 in the above code as that seemed to be what it's called in usr/bin.

I will keep it for future reference if anyone faces the same problem.

You might want to have a look at how a Linux is build from scratch this might shed some light, they explain on those sites as well why compiling with flags is not the best idea if you plan to rely on it.

Comments are closed.