Install gcc-8 only on Ubuntu 18.04?

Clash Royale CLAN TAG#URR8PPP up vote
8
down vote
favorite
I just installed Lubuntu 18.04 LTS. There are two options for installing gcc: gcc-7 and gcc-8. Both are available from apt-get install out of the box.
Even after I installed gcc-8, the system is still going to install gcc-7 when I install other packages such as build-essential.
Since gcc-8 is newer, is there a way to make it install gcc-8 and gcc-8 only?
gcc 18.04
add a comment |Â
up vote
8
down vote
favorite
I just installed Lubuntu 18.04 LTS. There are two options for installing gcc: gcc-7 and gcc-8. Both are available from apt-get install out of the box.
Even after I installed gcc-8, the system is still going to install gcc-7 when I install other packages such as build-essential.
Since gcc-8 is newer, is there a way to make it install gcc-8 and gcc-8 only?
gcc 18.04
Just don't installbuild-essentialbut the other packages it depend on directly?dpkg-dev g++-8 gcc-8 libc6-dev libc-dev make
â muru
Apr 27 at 5:41
gcc-7 is required by gcc-8. Note : You can have as many gcc/g++ versions as you want, installed at the same time. Bionic extras :g++-4.8 g++-5 g++-6 g++-8... ... g++-7/gcc-7 is the system compiler. The older versions are required for building some older applications.
â Knud Larsen
Apr 27 at 9:40
add a comment |Â
up vote
8
down vote
favorite
up vote
8
down vote
favorite
I just installed Lubuntu 18.04 LTS. There are two options for installing gcc: gcc-7 and gcc-8. Both are available from apt-get install out of the box.
Even after I installed gcc-8, the system is still going to install gcc-7 when I install other packages such as build-essential.
Since gcc-8 is newer, is there a way to make it install gcc-8 and gcc-8 only?
gcc 18.04
I just installed Lubuntu 18.04 LTS. There are two options for installing gcc: gcc-7 and gcc-8. Both are available from apt-get install out of the box.
Even after I installed gcc-8, the system is still going to install gcc-7 when I install other packages such as build-essential.
Since gcc-8 is newer, is there a way to make it install gcc-8 and gcc-8 only?
gcc 18.04
edited Jul 27 at 17:33
valiano
792313
792313
asked Apr 27 at 3:35
tinlyx
6731721
6731721
Just don't installbuild-essentialbut the other packages it depend on directly?dpkg-dev g++-8 gcc-8 libc6-dev libc-dev make
â muru
Apr 27 at 5:41
gcc-7 is required by gcc-8. Note : You can have as many gcc/g++ versions as you want, installed at the same time. Bionic extras :g++-4.8 g++-5 g++-6 g++-8... ... g++-7/gcc-7 is the system compiler. The older versions are required for building some older applications.
â Knud Larsen
Apr 27 at 9:40
add a comment |Â
Just don't installbuild-essentialbut the other packages it depend on directly?dpkg-dev g++-8 gcc-8 libc6-dev libc-dev make
â muru
Apr 27 at 5:41
gcc-7 is required by gcc-8. Note : You can have as many gcc/g++ versions as you want, installed at the same time. Bionic extras :g++-4.8 g++-5 g++-6 g++-8... ... g++-7/gcc-7 is the system compiler. The older versions are required for building some older applications.
â Knud Larsen
Apr 27 at 9:40
Just don't install
build-essential but the other packages it depend on directly? dpkg-dev g++-8 gcc-8 libc6-dev libc-dev makeâ muru
Apr 27 at 5:41
Just don't install
build-essential but the other packages it depend on directly? dpkg-dev g++-8 gcc-8 libc6-dev libc-dev makeâ muru
Apr 27 at 5:41
gcc-7 is required by gcc-8. Note : You can have as many gcc/g++ versions as you want, installed at the same time. Bionic extras :
g++-4.8 g++-5 g++-6 g++-8 ... ... g++-7/gcc-7 is the system compiler. The older versions are required for building some older applications.â Knud Larsen
Apr 27 at 9:40
gcc-7 is required by gcc-8. Note : You can have as many gcc/g++ versions as you want, installed at the same time. Bionic extras :
g++-4.8 g++-5 g++-6 g++-8 ... ... g++-7/gcc-7 is the system compiler. The older versions are required for building some older applications.â Knud Larsen
Apr 27 at 9:40
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
15
down vote
gcc-7 and gcc-8 will happily co-live together.
I would suggest to let gcc-7 be installed, for satisfying build-essential and perhaps other dependent packages, and configure gcc-8 to be your default gcc installation.
Use update-alternatives for having gcc redirected automatically to gcc-8:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
This will give you the convenience of gcc being at the latest version, and still you will be able to invoke gcc-7 or gcc-8 directly.
If you'll wish to change the default gcc version later on, run sudo update-alternatives --config gcc. It will bring a prompt similar to this, which lets you pick the version to be used:
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gcc-8 800 auto mode
1 /usr/bin/gcc-7 700 manual mode
2 /usr/bin/gcc-8 800 manual mode
Press <enter> to keep the current choice[*], or type selection number:
The higher priority is the one that is picked automatically by update-alternatives.
This should be the accepted answer.
â Maduka Jayalath
Aug 18 at 15:09
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
15
down vote
gcc-7 and gcc-8 will happily co-live together.
I would suggest to let gcc-7 be installed, for satisfying build-essential and perhaps other dependent packages, and configure gcc-8 to be your default gcc installation.
Use update-alternatives for having gcc redirected automatically to gcc-8:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
This will give you the convenience of gcc being at the latest version, and still you will be able to invoke gcc-7 or gcc-8 directly.
If you'll wish to change the default gcc version later on, run sudo update-alternatives --config gcc. It will bring a prompt similar to this, which lets you pick the version to be used:
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gcc-8 800 auto mode
1 /usr/bin/gcc-7 700 manual mode
2 /usr/bin/gcc-8 800 manual mode
Press <enter> to keep the current choice[*], or type selection number:
The higher priority is the one that is picked automatically by update-alternatives.
This should be the accepted answer.
â Maduka Jayalath
Aug 18 at 15:09
add a comment |Â
up vote
15
down vote
gcc-7 and gcc-8 will happily co-live together.
I would suggest to let gcc-7 be installed, for satisfying build-essential and perhaps other dependent packages, and configure gcc-8 to be your default gcc installation.
Use update-alternatives for having gcc redirected automatically to gcc-8:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
This will give you the convenience of gcc being at the latest version, and still you will be able to invoke gcc-7 or gcc-8 directly.
If you'll wish to change the default gcc version later on, run sudo update-alternatives --config gcc. It will bring a prompt similar to this, which lets you pick the version to be used:
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gcc-8 800 auto mode
1 /usr/bin/gcc-7 700 manual mode
2 /usr/bin/gcc-8 800 manual mode
Press <enter> to keep the current choice[*], or type selection number:
The higher priority is the one that is picked automatically by update-alternatives.
This should be the accepted answer.
â Maduka Jayalath
Aug 18 at 15:09
add a comment |Â
up vote
15
down vote
up vote
15
down vote
gcc-7 and gcc-8 will happily co-live together.
I would suggest to let gcc-7 be installed, for satisfying build-essential and perhaps other dependent packages, and configure gcc-8 to be your default gcc installation.
Use update-alternatives for having gcc redirected automatically to gcc-8:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
This will give you the convenience of gcc being at the latest version, and still you will be able to invoke gcc-7 or gcc-8 directly.
If you'll wish to change the default gcc version later on, run sudo update-alternatives --config gcc. It will bring a prompt similar to this, which lets you pick the version to be used:
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gcc-8 800 auto mode
1 /usr/bin/gcc-7 700 manual mode
2 /usr/bin/gcc-8 800 manual mode
Press <enter> to keep the current choice[*], or type selection number:
The higher priority is the one that is picked automatically by update-alternatives.
gcc-7 and gcc-8 will happily co-live together.
I would suggest to let gcc-7 be installed, for satisfying build-essential and perhaps other dependent packages, and configure gcc-8 to be your default gcc installation.
Use update-alternatives for having gcc redirected automatically to gcc-8:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
This will give you the convenience of gcc being at the latest version, and still you will be able to invoke gcc-7 or gcc-8 directly.
If you'll wish to change the default gcc version later on, run sudo update-alternatives --config gcc. It will bring a prompt similar to this, which lets you pick the version to be used:
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gcc-8 800 auto mode
1 /usr/bin/gcc-7 700 manual mode
2 /usr/bin/gcc-8 800 manual mode
Press <enter> to keep the current choice[*], or type selection number:
The higher priority is the one that is picked automatically by update-alternatives.
edited Apr 27 at 7:13
answered Apr 27 at 7:07
valiano
792313
792313
This should be the accepted answer.
â Maduka Jayalath
Aug 18 at 15:09
add a comment |Â
This should be the accepted answer.
â Maduka Jayalath
Aug 18 at 15:09
This should be the accepted answer.
â Maduka Jayalath
Aug 18 at 15:09
This should be the accepted answer.
â Maduka Jayalath
Aug 18 at 15:09
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028601%2finstall-gcc-8-only-on-ubuntu-18-04%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Just don't install
build-essentialbut the other packages it depend on directly?dpkg-dev g++-8 gcc-8 libc6-dev libc-dev makeâ muru
Apr 27 at 5:41
gcc-7 is required by gcc-8. Note : You can have as many gcc/g++ versions as you want, installed at the same time. Bionic extras :
g++-4.8 g++-5 g++-6 g++-8... ... g++-7/gcc-7 is the system compiler. The older versions are required for building some older applications.â Knud Larsen
Apr 27 at 9:40