Ask Your Question

How to install old and new version of gcc from rpm?

asked 2015-12-06 11:47:26 -0500

mod0 gravatar image


I am trying to use Matlab MEX compiler. I am running Fedora 21 which comes with gcc 4.9.2. Matlab however only supports gcc 4.7.x. Although MEX does compile and stuff works, I do not see desired scaling when using OpenMP and I suspect its because of the gcc compiler. I was wondering if it is possible to load both 4.7.x and 4.9.x. I downloaded an rpm of 4.7.x built for fc19 and tried to install it yesterday. However, I get the following message when I attempt to yum localinstall it.

user@host:Downloads$ sudo yum localinstall gcc-4.7.2-8.fc19.x86_64.rpm 
[sudo] password for user:
Loaded plugins: auto-update-debuginfo, langpacks
Examining gcc-4.7.2-8.fc19.x86_64.rpm: gcc-4.7.2-8.fc19.x86_64
gcc-4.7.2-8.fc19.x86_64.rpm: does not update installed package.
Nothing to do
edit retag flag offensive close merge delete


Welcome to ask.fedora. You may not be aware, but Fedora 21 has just reached End Of Life and is no longer supported. You might consider upgrading to either version 22 or 23, both for security reasons and for the possibility that you'll get a newer version of MEX that works with current versions of gcc. Good luck, and keep us informed.

sideburns gravatar imagesideburns ( 2015-12-06 15:27:31 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-06 13:09:58 -0500

The command is sudo yum downgrade <lib1> <lib2> <package>

If you have the error "package X requires X-lib" then fill the lib1 with the dependency, lib2 with the second dependency...

You can also remove (sudo yum remove gcc) thus install with the command you wrote.

edit flag offensive delete link more


Hey, I am also new and have the same Matlab problem with fedora 23. Thanks for your answer, but I don't quite understand it. Will this enable me to have both gcc-5.3 and gcc-4.7 at the same time? Sorry for being noob.

Honigmelone gravatar imageHonigmelone ( 2016-01-28 18:40:49 -0500 )edit

Question Tools

1 follower


Asked: 2015-12-06 11:46:37 -0500

Seen: 1,449 times

Last updated: Dec 06 '15