Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microdnf cannot reinstall curl-minimal #137

Closed
dwmarshall opened this issue Aug 7, 2023 · 4 comments · Fixed by rpm-software-management/libdnf#1650
Closed

microdnf cannot reinstall curl-minimal #137

dwmarshall opened this issue Aug 7, 2023 · 4 comments · Fixed by rpm-software-management/libdnf#1650
Assignees
Labels
Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@dwmarshall
Copy link

with regular dnf:

$ podman run --rm registry.access.redhat.com/ubi9/ubi dnf reinstall -q -y curl-minimal

Reinstalled:
  curl-minimal-7.76.1-23.el9_2.2.x86_64

with microdnf:

$ podman run --rm registry.access.redhat.com/ubi9/ubi-minimal microdnf reinstall -y curl-minimal

(microdnf:1): librhsm-WARNING **: 16:56:00.224: Found 0 entitlement certificates

(microdnf:1): librhsm-WARNING **: 16:56:00.225: Found 0 entitlement certificates
Downloading metadata...
Downloading metadata...
Downloading metadata...
Package                                            Repository            Size
Reinstalling:
 curl-minimal-7.76.1-23.el9_2.2.x86_64             ubi-9-baseos-rpms 132.3 kB
   replacing curl-minimal-7.76.1-23.el9_2.2.x86_64
Transaction Summary:
 Installing:        0 packages
 Reinstalling:      1 packages
 Upgrading:         0 packages
 Obsoleting:        0 packages
 Removing:          0 packages
 Downgrading:       0 packages
Downloading packages...
Running transaction test...
error: Error running transaction: curl conflicts with curl-minimal-7.76.1-23.el9_2.2.x86_64
curl conflicts with (installed) curl-minimal-7.76.1-23.el9_2.2.x86_64
$ podman run --rm registry.access.redhat.com/ubi9/ubi-minimal rpm -q microdnf
microdnf-3.9.1-3.el9.x86_64
@robbmanes
Copy link

This appears to be caused by any package that has a Conflicts tag in the spec that has the exact same name configured in Provides. The above curl package provided above does this:

$ curl -o curl-minimal-7.76.1-23.el9_2.2.x86_64.rpm https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi9/9/x86_64/baseos/os/Packages/c/curl-minimal-7.76.1-23.el9_2.2.x86_64.rpm

$ rpm -qp --conflicts curl-minimal-7.76.1-23.el9_2.2.x86_64.rpm
curl

$ rpm -qp --provides curl-minimal-7.76.1-23.el9_2.2.x86_64.rpm
curl = 7.76.1-23.el9_2.2
curl-minimal = 7.76.1-23.el9_2.2
curl-minimal(x86-64) = 7.76.1-23.el9_2.2

And if I make my own package, host it, and then try to reinstall it it fails in the same way. My specfile:

Name:           hello
Version:        0.0.1
Release:        1%{?dist}
Summary:        Hello World

License:        GPL
Source0:        %{name}-%{version}.tar.gz

Requires:       bash
Conflicts:      hello
Provides:       hello


%description
A demo RPM build

%prep
%autosetup

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp %{name}.sh $RPM_BUILD_ROOT/%{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/%{name}.sh

%changelog
* Mon Aug 07 2023 Robb Manes <robbmanes@myemail.com>
- First change

And note that plain dnf or yum (really yum2) have no problems, but microdnf does upon trying to reinstall:

# dnf reinstall /home/rmanes/rpmbuild/RPMS/x86_64/hello-0.0.1-1.el9.x86_64.rpm -y
[...]
Reinstalled:
  hello-0.0.1-1.el9.x86_64

# microdnf reinstall hello -y
[...]
error: Error running transaction: hello conflicts with hello-0.0.1-1.el9.x86_64
hello conflicts with (installed) hello-0.0.1-1.el9.x86_64

@robbmanes
Copy link

Filed as bz2229809 internally for Red Hat.

@dmnks
Copy link

dmnks commented Aug 9, 2023

Works fine with RPM:

# rpm -U --reinstall /root/rpmbuild/RPMS/x86_64/hello-0.0.1-1.el9.x86_64.rpm

Is microdnf using rpmtsAddReinstallElement() here?

@j-mracek j-mracek self-assigned this Aug 9, 2023
@j-mracek
Copy link
Contributor

j-mracek commented Aug 9, 2023

Thank you Michal, I think this is the issue.

@j-mracek j-mracek added the Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take label Sep 12, 2023
@j-mracek j-mracek removed their assignment Sep 12, 2023
@kontura kontura self-assigned this Apr 4, 2024
kontura added a commit to kontura/libdnf that referenced this issue Apr 8, 2024
`rpmtsAddInstallElement()` doesn't work for all reinstall cases, such as
when a package `Provides` and `Conflicts` with the same capability.

Fixes: rpm-software-management/microdnf#137
jan-kolarik pushed a commit to rpm-software-management/libdnf that referenced this issue Apr 12, 2024
`rpmtsAddInstallElement()` doesn't work for all reinstall cases, such as
when a package `Provides` and `Conflicts` with the same capability.

Fixes: rpm-software-management/microdnf#137
ppisar pushed a commit to ppisar/libdnf that referenced this issue May 16, 2024
Upstream commit: 85432df

`rpmtsAddInstallElement()` doesn't work for all reinstall cases, such as
when a package `Provides` and `Conflicts` with the same capability.

Fixes: rpm-software-management/microdnf#137
Resolves: https://issues.redhat.com/browse/RHEL-1454
kontura added a commit to rpm-software-management/libdnf that referenced this issue May 20, 2024
Upstream commit: 85432df

`rpmtsAddInstallElement()` doesn't work for all reinstall cases, such as
when a package `Provides` and `Conflicts` with the same capability.

Fixes: rpm-software-management/microdnf#137
Resolves: https://issues.redhat.com/browse/RHEL-1454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants