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

Package belonging to a comps group cannot be marked as dependency #1976

Open
roshanshariff opened this issue Dec 24, 2024 · 0 comments
Open
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@roshanshariff
Copy link

If a package belongs to a comps group, then it cannot be marked as a "dependency" using dnf mark. It can only be marked as "user" or "group".

For example, cmake is an optional package in the c-development group:

$ dnf group list --contains-pkgs cmake
Updating and loading repositories:
Repositories loaded.
ID                       Name                                  Installed
c-development            C Development Tools and Libraries           yes
d-development            D Development Tools and Libraries            no
kde-software-development KDE Software Development                     no
kf6-software-development KDE Frameworks 6 Software Development        no

But I have installed it manually and so it is marked as user-installed:

$ dnf rq --installed --qf '%{reason}\n' cmake
User

First bug: Trying to mark it as a group package doesn't work. Dnf claims it is changing the reason from User to Group, but the change does not happen:

$ sudo dnf mark group c-development cmake
Package                                      Arch        Version                                      Repository                  Size
Changing reason:
 cmake                                       x86_64      3.30.5-1.fc41                                @System                 32.5 MiB
   User -> Group                                                                                                                      

Transaction Summary:
 Changing reason:    1 package

After this operation, 0 B extra will be used (install 0 B, remove 0 B).
Is this ok [y/N]: y
Running transaction
Complete!
$ dnf rq --installed --qf '%{reason}\n' cmake
User

Second bug: Trying to mark the package as a dependency (so that it will be autoremoved if unneeded by another package) also does not work. Instead, trying to do this changes its reason to "Group":

$ sudo dnf mark dependency cmake
Package                                      Arch        Version                                      Repository                  Size
Changing reason:
 cmake                                       x86_64      3.30.5-1.fc41                                @System                 32.5 MiB
   User -> Dependency                                                                                                                 

Transaction Summary:
 Changing reason:    1 package

After this operation, 0 B extra will be used (install 0 B, remove 0 B).
Is this ok [y/N]: y
Running transaction
Complete!
$ dnf rq --installed --qf '%{reason}\n' cmake
Group

So, to summarize, the dnf mark group command does not work for user-installed packages that are in a comps group, and dnf mark dependency actually marks such packages as group-installed. There is no way to mark such a package as a dependency.

I am using Fedora 41 and dnf 5.2.8.1:

$ dnf --version
dnf5 version 5.2.8.1
dnf5 plugin API version 2.0
libdnf5 version 5.2.8.1
libdnf5 plugin API version 2.0

Loaded dnf5 plugins:
  name: builddep
  version: 1.0.0
  API version: 2.0

  name: changelog
  version: 1.0.0
  API version: 2.0

  name: config-manager
  version: 0.1.0
  API version: 2.0

  name: copr
  version: 0.1.0
  API version: 2.0

  name: needs_restarting
  version: 1.0.0
  API version: 2.0

  name: repoclosure
  version: 1.0.0
  API version: 2.0

  name: reposync
  version: 1.0.0
  API version: 2.0
@pkratoch pkratoch added Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
None yet
Development

No branches or pull requests

2 participants