0

I have a CentOS Stream 8 server with a backup application that requires the kernel to be compiled with the same version of gcc. Latest kernel is: 4.18.0-408.el8.x86_64

I inadvertently updated gcc in the course of doing updates, and it's currently: gcc version 8.5.0 20210514 (Red Hat 8.5.0-15) (GCC)

gcc 8.5 was apparently backported from CentOS Stream 9 into 8, and that's causing problems for me.

I need to downgrade gcc to 8.4, which is available. Of course when I try, I get the following errors:

]# dnf install gcc-8.4.1-1.el8.x86_64
Last metadata expiration check: 0:09:42 ago on Fri 28 Oct 2022 12:15:53 AM PDT.
Error:
 Problem: problem with installed package gcc-plugin-annobin-8.5.0-15.el8.x86_64
  - package gcc-plugin-annobin-8.5.0-15.el8.x86_64 requires gcc = 8.5.0-15.el8, but none of the providers can be installed
  - package gcc-plugin-annobin-8.5.0-13.el8.x86_64 requires gcc = 8.5.0-13.el8, but none of the providers can be installed
  - package gcc-plugin-annobin-8.5.0-14.el8.x86_64 requires gcc = 8.5.0-14.el8, but none of the providers can be installed
  - cannot install both gcc-8.4.1-1.el8.x86_64 and gcc-8.5.0-15.el8.x86_64
  - cannot install both gcc-8.5.0-13.el8.x86_64 and gcc-8.4.1-1.el8.x86_64
  - cannot install both gcc-8.5.0-14.el8.x86_64 and gcc-8.4.1-1.el8.x86_64
  - cannot install both gcc-8.5.0-15.el8.x86_64 and gcc-8.4.1-1.el8.x86_64
  - conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
]# dnf remove gcc
Dependencies resolved.
===========================================================================================================================================================================
 Package                                           Architecture                      Version                                   Repository                             Size
===========================================================================================================================================================================
Removing:
 gcc                                               x86_64                            8.5.0-15.el8                              @appstream                             59 M
Removing dependent packages:
 BackupAndRecoveryAgent                            x86_64                            15.0.30430-1                              @System                               933 M
 annobin                                           x86_64                            10.67-3.el8                               @appstream                            968 k
 dkms                                              noarch                            3.0.7-1.el8                               @epel                                 151 k
 file_protector                                    noarch                            1.1-1497                                  @System                               8.3 M
 gcc-plugin-annobin                                x86_64                            8.5.0-15.el8                              @appstream                             48 k
 snapapi26_modules                                 noarch                            0.8.15-1                                  @System                               5.2 M
Removing unused dependencies:
 cpp                                               x86_64                            8.5.0-15.el8                              @appstream                             28 M
 glibc-devel                                       x86_64                            2.28-214.el8                              @baseos                               234 k
 glibc-headers                                     x86_64                            2.28-214.el8                              @baseos                               1.9 M
 isl                                               x86_64                            0.16.1-6.el8                              @AppStream                            3.1 M
 kernel-headers                                    x86_64                            4.18.0-408.el8                            @baseos                               5.2 M
 libmpc                                            x86_64                            1.1.0-9.1.el8                             @appstream                            124 k
 libxcrypt-devel                                   x86_64                            4.1.1-6.el8                               @baseos                                24 k

Transaction Summary
===========================================================================================================================================================================
Remove  14 Packages

Should I do dnf remove gcc-plugin-annobin and dnf install gcc-8.4.1-1.el8.x86_64 --skip-broken? Will everything fall into place once 8.4 is installed? Or should I remove gcc and gcc-plugin-annobin and install the version I need?

I just want to be cautious so nothing breaks.

Thank you.

location
  • 1
  • 1
  • 1
    dnf has a downgrade command - did you try `dnf downgrade gcc` ? – Martin Oct 28 '22 at 08:00
  • After I downgrade a couple of times, I am at gcc-8.5.0-13.el8.x86_64, and it gives me an error very similar to the one I posted above: Problem: problem with installed package gcc-plugin-annobin-8.5.0-13.el8.x86_64 - package gcc-plugin-annobin-8.5.0-13.el8.x86_64 requires gcc = 8.5.0-13.el8, but none of the providers can be installed etc etc – location Oct 28 '22 at 10:11
  • I just realized that you are on CentOS stream ... unlike other distributions, this is more like a rolling release than a stable distribution - which makes it unsuitable for your needs, since you require a specific version of the gcc compiler. So either you have to install gcc manually, or you have to switch the distribution you are working on... – Martin Oct 28 '22 at 10:46
  • You're right, I have some other issues due to what you mention. Also, I was able to install the gcc version I need. – location Oct 28 '22 at 10:53

1 Answers1

0

I was able to fix the problem by using --allowerasing

]# dnf install gcc-8.4.1-1.el8.x86_64 --allowerasing removed gcc 8.5 and installed 8.4

location
  • 1
  • 1