dnf reports problems with updating libgomp etc. due to conflicting gcc versions

0

I regularly update EC2 Linux 2023 using dnf. However, when I tried to update using sudo dnf upgrade --releasever=2023.7.20250331 problems were reported:

Amazon Linux 2023 repository                                                                                                                            71 MB/s |  35 MB     00:00    
Last metadata expiration check: 0:00:10 ago on Mon 21 Apr 2025 20:11:57 BST.
Dependencies resolved.

 Problem 1: cannot install both libgomp-14.2.1-7.amzn2023.0.1.aarch64 from amazonlinux and libgomp-13.0.1-0.12.fc38.aarch64 from @System
  - package gcc-13.0.1-0.12.fc38.aarch64 from @System requires libgomp = 13.0.1-0.12.fc38, but none of the providers can be installed
  - cannot install the best update candidate for package libgomp-13.0.1-0.12.fc38.aarch64
  - problem with installed package gcc-13.0.1-0.12.fc38.aarch64
 Problem 2: cannot install both libstdc++-14.2.1-7.amzn2023.0.1.aarch64 from amazonlinux and libstdc++-13.0.1-0.12.fc38.aarch64 from @System
  - package gcc-c++-13.0.1-0.12.fc38.aarch64 from @System requires libstdc++ = 13.0.1-0.12.fc38, but none of the providers can be installed
  - cannot install the best update candidate for package libstdc++-13.0.1-0.12.fc38.aarch64
  - problem with installed package gcc-c++-13.0.1-0.12.fc38.aarch64
 Problem 3: package amazon-rpm-config-228-7.amzn2023.0.1.noarch from amazonlinux requires (gcc-plugin-annobin if gcc >= 11.5.0), but none of the providers can be installed
  - package gcc-plugin-annobin-11.5.0-5.amzn2023.0.1.aarch64 from amazonlinux requires gcc = 11.5.0-5.amzn2023.0.1, but none of the providers can be installed
  - package gcc-plugin-annobin-11.5.0-5.amzn2023.0.3.aarch64 from amazonlinux requires gcc = 11.5.0-5.amzn2023.0.3, but none of the providers can be installed
  - cannot install both gcc-11.5.0-5.amzn2023.0.1.aarch64 from amazonlinux and gcc-13.0.1-0.12.fc38.aarch64 from @System
  - cannot install both gcc-11.5.0-5.amzn2023.0.3.aarch64 from amazonlinux and gcc-13.0.1-0.12.fc38.aarch64 from @System
  - cannot install the best update candidate for package gcc-13.0.1-0.12.fc38.aarch64
  - cannot install the best update candidate for package amazon-rpm-config-228-4.amzn2023.0.1.noarch

dnf advised that I retry, adding '--best --allowerasing' to command line to force their upgrade, but this had no effect - the same problems are reported.

What do I do?

asked a month ago41 views
1 Answer
0
Accepted Answer

The issue you're experiencing is due to conflicts between the installed GCC version and the version available in the Amazon Linux 2023 repository you're trying to update to. This can happen when you have a newer or different version of GCC installed than what's expected in the target repository.

To resolve this, you have a few options:

  1. Remove the conflicting packages and then perform the upgrade: First, remove the problematic GCC packages:

    sudo dnf remove gcc gcc-c++
    

    Then attempt the upgrade again:

    sudo dnf upgrade --releasever=2023.7.20250331
    
  2. If you need to keep your current GCC version, you might consider using a more recent AL2023 release version that's compatible with your installed GCC version. Check the available versions and try updating to a newer one.

  3. If you're running a critical system, it's advisable to create a backup or snapshot of your instance before making significant changes. You could then test the update process on a separate, non-production instance to ensure it works correctly before applying it to your production environment.

  4. If the problems persist, you might need to consider launching a new instance with the desired AL2023 version and migrate your data and applications to it. This approach ensures you're starting with a clean, consistent system state.

Remember, when updating Amazon Linux 2023, it's generally recommended to use a specific release version rather than 'latest' to ensure consistency and avoid unexpected issues in production environments. Always test updates in a non-production environment first when possible.
Sources
Using Deterministic upgrades through versioned repositories - Amazon Linux 2023
Manage package and operating system updates in AL2023 - Amazon Linux 2023
Best practices for safely deploying updates - Amazon Linux 2023

profile picture
answered a month ago
profile pictureAWS
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions