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

Modify dnf and microdnf obsoletes for RHEL #780

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

j-mracek
Copy link
Contributor

The patch prevents replacement of microdnf and dnf by dnf5 in RHEL10 and previous versions.

The patch prevents replacement of microdnf and dnf by dnf5 in RHEL10
and previous versions.
The change will effect also rawhide users.
@j-mracek j-mracek added the blocked Further work on issue or PR is blocked by something else label Jul 27, 2023
@j-mracek
Copy link
Contributor Author

It requires additional change in DNF related to dnf.conf.

Copy link
Member

@evan-goode evan-goode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! On a Rawhide system, I was able to upgrade DNF 5 with this patch and then install DNF with rpm-software-management/dnf#1975.

Note: I was unable to do this in a single transaction, but that shouldn't be an issue.

@j-mracek
Copy link
Contributor Author

j-mracek commented Aug 1, 2023

LGTM! On a Rawhide system, I was able to upgrade DNF 5 with this patch and then install DNF with rpm-software-management/dnf#1975.

Note: I was unable to do this in a single transaction, but that shouldn't be an issue.

I am just curios - did you tried dnf5 install dnf dnf5 --best. It should install dnf and upgrade dnf5.

@evan-goode
Copy link
Member

Yes, I bumped the release versions just to make sure. Maybe I'm missing something.

Click to expand

evan@rawhide ~/git/dnf $ sudo dnf5 info dnf5 dnf

Updating and loading repositories:
Repositories loaded.
Installed packages
Name            : dnf5
Epoch           : 0
Version         : 5.1.0
Release         : 2.fc39
Architecture    : x86_64
Installed size  : 1.1 MiB
Source          : dnf5-5.1.0-2.fc39.src.rpm
From repository : rawhide
Summary         : Command-line package manager
URL             : https://github.com/rpm-software-management/dnf5
License         : GPL-2.0-or-later
Description     : DNF5 is a command-line package manager that automates the process of installing,
                : upgrading, configuring, and removing computer programs in a consistent manner.
                : It supports RPM packages, modulemd modules, and comps groups & environments.
Vendor          : Fedora Project

Available packages
Name            : dnf
Epoch           : 0
Version         : 4.16.2
Release         : 2.git.9573.78db5f1.fc39
Architecture    : noarch
Download size   : 463.0 KiB
Installed size  : 2.3 MiB
Source          : dnf-4.16.2-2.git.9573.78db5f1.fc39.src.rpm
Repository      : local-repo
Summary         : Package manager
URL             : https://github.com/rpm-software-management/dnf
License         : GPL-2.0-or-later AND GPL-1.0-only
Description     : Utility that allows users to manage packages on their systems.
                : It supports RPMs, modules and comps groups & environments.
Vendor          : 

Name            : dnf5
Epoch           : 0
Version         : 5.1.0
Release         : 2.fc39
Architecture    : i686
Download size   : 490.5 KiB
Installed size  : 1.2 MiB
Source          : dnf5-5.1.0-2.fc39.src.rpm
Repository      : rawhide
Summary         : Command-line package manager
URL             : https://github.com/rpm-software-management/dnf5
License         : GPL-2.0-or-later
Description     : DNF5 is a command-line package manager that automates the process of installing,
                : upgrading, configuring, and removing computer programs in a consistent manner.
                : It supports RPM packages, modulemd modules, and comps groups & environments.
Vendor          : Fedora Project

Name            : dnf5
Epoch           : 0
Version         : 5.1.0
Release         : 3.fc39
Architecture    : x86_64
Download size   : 444.7 KiB
Installed size  : 1.1 MiB
Source          : dnf5-5.1.0-3.fc39.src.rpm
Repository      : local-repo
Summary         : Command-line package manager
URL             : https://github.com/rpm-software-management/dnf5
License         : GPL-2.0-or-later
Description     : DNF5 is a command-line package manager that automates the process of installing,
                : upgrading, configuring, and removing computer programs in a consistent manner.
                : It supports RPM packages, modulemd modules, and comps groups & environments.
Vendor          : 

Then:

evan@rawhide ~/git/dnf $ sudo dnf5 install dnf5 dnf --setopt=allow_vendor_change=yes --best         
Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Package "dnf5-5.1.0-2.fc39.x86_64" is already installed.
Problem: cannot install both dnf5-5.1.0-2.fc39.x86_64 and dnf5-5.1.0-3.fc39.x86_64
  - cannot install the best candidate for the job

Installing only DNF 5 works:

evan@rawhide ~/git/dnf $ sudo dnf5 install dnf5 --setopt=allow_vendor_change=yes --best 
Updating and loading repositories:
Repositories loaded.
Package "dnf5-5.1.0-2.fc39.x86_64" is already installed.

Package                                         Arch   Version                                         Repository                                              Size
Upgrading:                                                                                                                                                         
 dnf-data                                       noarch 4.16.2-2.git.9573.78db5f1.fc39                  local-repo                                          38.4 KiB
  replacing dnf-data                            noarch 4.16.2-1.fc39                                   copr:copr.fedorainfracloud.org:group_python:python  38.2 KiB
 dnf5                                           x86_64 5.1.0-3.fc39                                    local-repo                                           1.1 MiB
  replacing dnf5                                x86_64 5.1.0-2.fc39                                    rawhide                                              1.1 MiB
 dnf5-plugins                                   x86_64 5.1.0-3.fc39                                    local-repo                                         577.8 KiB
  replacing dnf5-plugins                        x86_64 5.1.0-2.fc39                                    rawhide                                            574.8 KiB
 libdnf5                                        x86_64 5.1.0-3.fc39                                    local-repo                                           2.5 MiB
  replacing libdnf5                             x86_64 5.1.0-2.fc39                                    rawhide                                              2.5 MiB
 libdnf5-cli                                    x86_64 5.1.0-3.fc39                                    local-repo                                         535.1 KiB
  replacing libdnf5-cli                         x86_64 5.1.0-2.fc39                                    rawhide                                            530.0 KiB
 python3-dnf                                    noarch 4.16.2-2.git.9573.78db5f1.fc39                  local-repo                                           2.6 MiB
   replacing python3-dnf                        noarch 4.16.2-1.fc39                                   copr:copr.fedorainfracloud.org:group_python:python   2.6 MiB

Transaction Summary:
 Upgrading:         6 packages
 Replacing:         6 packages

Total size of inbound packages is 2 MiB. Need to download 2 MiB.
After this operation 16 KiB will be used (install 7 MiB, remove 7 MiB).
Is this ok [y/N]: 

Remind me of the procedure to get debug output from the solver? I remember you or someone else on the team gave a presentation about it but I can't find the link any more.

@gotmax23
Copy link
Contributor

gotmax23 commented Aug 2, 2023

Using >= comparisons (e.g. 0%{?fedora} >= 41 instead of 0%{?fedora} > 40 ) would make this more technically correct and comprehensible.

@j-mracek j-mracek removed the blocked Further work on issue or PR is blocked by something else label Aug 4, 2023
@inknos inknos added this pull request to the merge queue Aug 4, 2023
Merged via the queue into rpm-software-management:main with commit 4578178 Aug 4, 2023
4 of 6 checks passed
@inknos
Copy link
Collaborator

inknos commented Aug 4, 2023

@gotmax23, sorry for not answering. I am merging the PR because we need this change to be in fedora before branching. I am about to make another specfile related PR with less urgent changes, and I will consider your suggestion.

@gotmax23
Copy link
Contributor

gotmax23 commented Aug 4, 2023

Makes sense. Thanks @inknos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants