Is it possible to downgrade the gcc version in Rocky 9.2?

I upgraded from Rocky 8.7 to 9.2.
Looking at the gcc version afterwards, it’s 11.
I want to downgrade to 8.5. Is it possible?
If possible, please tell me what to do.

Hi,

Upgrades aren’t really supported, although whilst they work, they could be problematic. Downgrades are not supported whatsoever. You would need to revert to a backup or snapshot of your machine taken before the upgrade.

GCC downgrades within 9.2 are not supported whatsoever. Each version has an appropriate version of GCC that it requires. If Rocky 9 (RHEL9) requires GCC 11 then that is what it would need to be. Potentially you could build and install GCC 8.5 alongside it, but I wouldn’t recommend it.

Best is to use a distro that has the version of GCC that you require. In which case, would mean reverting to Rocky 8 if Rocky 8 has GCC 8.5.

1 Like

You should explain why you want that.

1 Like

You could run Rocky 8 and your compiler in a container, its probably less work

2 Likes

Thank you for your reply.

I wanted it for a minor compilation problem, but I don’t think so. Thank you for your reply.

You real issue was a compilation error? Then you presumed that change of GCC version might solve that. That created a “new issue”: how to change version of GCC.

You could have started by showing the compiler error message and then ask how to solve that.