Ask Your Question

Fedora23 install Cpp older version compiler

asked 2016-04-11 02:20:33 -0500

buddy gravatar image


i would like to ask how can one have more versions of the same compiler installed in fedora 23. F23 uses the latest 5.x.x version:

g++ --version

gives the answer: g++ (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2). But for my work i need the older version 4.9.x. Because i am using and also editing piece of software which definitely runs with 4.9.x. RPMs could be downloaded from 'koji' that's not the problem. Let's say i would like to install all these rpm to my home folder


But if i type:

sudo rpm -i --prefix="$PATH" ~/Downloads/cpp-4.9.2-5.fc22.x86_64.rpm

The answer is simple: The package cpp is not movable

I would really appreciate some helpful thoughts or any possible solution (no the one with downgrading current compilller)


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-04-11 11:38:47 -0500

davidva gravatar image

updated 2016-04-11 21:55:07 -0500

Hi, I made a gcc4.9 for these purposes in COPR...

How to install?

1) su

2) dnf -y copr enable davidva/gcc49

3) dnf install gcc49

Good luck. :)

edit flag offensive delete link more


Hey, why aren't you building F24+ in copr? The google drive repo thing is really sketchy...

randomuser gravatar imagerandomuser ( 2016-04-11 13:26:43 -0500 )edit

@randomuser I can not use COPR with packages patented. The google drive repo; isn't my property ...

davidva gravatar imagedavidva ( 2016-04-11 14:06:46 -0500 )edit

If the packages are not permissible for COPR, please do not use your COPR to advertise them.

randomuser gravatar imagerandomuser ( 2016-04-11 14:08:06 -0500 )edit

All my COPRs have licenses allowed by Fedora Project; If I share other routes it is because surely under USA laws do not allow me to. Fedora is sponsored by Red Hat; and Red Hat reside in USA.. Also, You can report any copr; If your check has actually violated the use and terms of use.

davidva gravatar imagedavidva ( 2016-04-11 14:44:30 -0500 )edit

I downloaded the repo file to check out the packages - I would report your repo if you were advertising impermissible content there - and it points to . WTF?

randomuser gravatar imagerandomuser ( 2016-04-11 20:36:35 -0500 )edit

answered 2016-04-12 00:32:23 -0500

updated 2016-04-12 05:37:30 -0500

I would like to suggest you consider cross-compilation approach. But for your purpose it will be not a real cross-compilation between different architectures, but just using standalone compiler with correct path to compiler's own libraries and headers. For example if you have a look into yocto, it could prepare for you any toolchain you want let's say for x86_64 architecture (or any other). After this you just need to use prepared shell script (just typing something like 'source') it will switch all needed environment variables like CC, CXX, LD, SYSROOT, CPP, AR, etc... to the newly prepared compiler version.

So, the full instructions would be following:

1) Download poky toolchain:

git clone

2) Prepare a project files:

source poky/oe-init-build-env new_project_dir  
cd new_project_dir

3) Build only compiler

MACHINE=x86_64 bitbake core-image-minimal -c populate_sdk

4) Install just built compiler
Run just prepared shell script


(your script name could differ because it depends on target architecture and poky version)

That will generate the "switching" script to use newly prepared toolchain with needed version of compiler,linker and etc. seamlessly like it is a system default compiler set. It would not touch your system files, so you can be pretty sure that this is safe operation.

Details you can find here: ( 3.4 Optionally Building a Toolchain Installer)
and good example here ( 5.1.1 Creating and Running a Project Based on GNU Autotools)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2016-04-11 02:20:33 -0500

Seen: 1,647 times

Last updated: Apr 12 '16