Skip to content

[Bug] - microdnf does not respect --releasever flag in minimal container image #854

Open
@wesner-price

Description

@wesner-price

Ran into this issue trying to upgrade dependencies with published vulnerabilities.

This is not an issue if I was using the latest release of AL2023 minimal container image, as it points to the updated package repo.
However, I am using the public.ecr.aws/lambda/nodejs:20 image, and it has not been updated to the latest version of AL2023, it is still version 2023.6.20241031.
Regardless I believe the bug is present in all versions of the minimal container image.

An example vulnerability is https://alas.aws.amazon.com/AL2023/ALAS-2024-759.html
The correction is to run dnf update expat --releasever 2023.6.20241111

But on minimal container images which use microdnf this is not working.
Resulting in a nothing to do status, see output attached below.

I have found a workaround to update the packages, and that is to manually set the release version in the repo file.
sed -i 's/$releasever/2023.6.20241121/g' /etc/yum.repos.d/amazonlinux.repo

I suspect that something is wrong with how microdnf is setting the release version in /etc/yum.repos.d/amazonlinux.repo.

To Reproduce
Steps to reproduce the behavior:

  1. run docker image public.ecr.aws/amazonlinux/amazonlinux:2023.6.20241031.0-minimal
  2. run dnf install expat -y
  3. see that dnf installs expat-2.5.0-1.amzn2023.0.4.x86_64
  4. run dnf upgrade expat -y --releasever=2023.6.20241121 --refresh
  5. see that there is nothing to do
  6. run sed -i 's/$releasever/2023.6.20241121/g' /etc/yum.repos.d/amazonlinux.repo
  7. run dnf upgrade expat -y --refresh
  8. see that dnf upgrades to expat-2.6.3-1.amzn2023.0.1.x86_64

Expected behavior
I would expect that on step 4 that dnf would upgrade expat to 2.6.3

Screenshots
If applicable, add screenshots to help explain your problem.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestpackagesPackage request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions