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

Update of documentation of autoremove command #2060

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

j-mracek
Copy link
Contributor

@j-mracek j-mracek commented Mar 8, 2024

No description provided.

j-mracek added 2 commits March 8, 2024 12:51
Installonly packages are handled by autoremove command in a similar
way like other package.

Resolves: https://issues.redhat.com/browse/RHEL-15902
Leaf packages term is not define in documentation and it even
represent different set of packages that are showed by leaves command.

Related: https://issues.redhat.com/browse/RHELDOCS-17711
@m-blaha m-blaha self-assigned this Mar 8, 2024
@m-blaha
Copy link
Member

m-blaha commented Mar 8, 2024

Installonly packages are once more mentioned as those not affected by autoremove command in dnf history userinstalled description:

dnf/doc/command_ref.rst

Lines 800 to 806 in 96f8d79

``dnf history userinstalled``
Show all installonly packages, packages installed outside of DNF and packages not
installed as dependency. I.e. it lists packages that will stay on the system when
:ref:`\autoremove_command-label` or :ref:`\remove_command-label` along with
`clean_requirements_on_remove` configuration option set to True is executed. Note the same
results can be accomplished with ``dnf repoquery --userinstalled``, and the repoquery
command is more powerful in formatting of the output.

I think this command also does not do any special handling for installonly packages and the documentation should be updated accordingly.

The described behavior differs from current behavior therefore
it might create a confusion.
@j-mracek
Copy link
Contributor Author

j-mracek commented Mar 8, 2024

I think that formal description was valid in past. I remember that DNF had a problem in inheritance of kernel reason therefore it somehow mark all installonly packages as user installed or unknown. Hopefully the issue is gone.

Copy link
Member

@m-blaha m-blaha left a comment

Choose a reason for hiding this comment

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

Thank you!

@j-mracek
Copy link
Contributor Author

j-mracek commented Mar 8, 2024

Anyway I have a bad news. DNF does not keep reason of installonly packages. But I have to doublecheck

@j-mracek
Copy link
Contributor Author

j-mracek commented Mar 8, 2024

I tried following:
Note: Issue confirmed with standard dnf

# dnf repoquery --installed kernel* --qf="%{name} %{reason}"
kernel user
kernel-core user
kernel-headers unknown
kernel-modules user
kernel-modules-core user
kernel-modules-extra dependency
kernel-srpm-macros dependency
# sudo dnf upgrade kernel*
Last metadata expiration check: 2:58:48 ago on Fri 08 Mar 2024 11:14:59 AM CET.
Dependencies resolved.
==============================================================================================================================================================================================
 Package                                              Architecture                           Version                                            Repository                               Size
==============================================================================================================================================================================================
Installing:
 kernel                                               x86_64                                 6.7.7-100.fc38                                     updates                                 161 k
 kernel-core                                          x86_64                                 6.7.7-100.fc38                                     updates                                  16 M
 kernel-modules                                       x86_64                                 6.7.7-100.fc38                                     updates                                  59 M
 kernel-modules-core                                  x86_64                                 6.7.7-100.fc38                                     updates                                  33 M
Installing dependencies:
 kernel-modules-extra                                 x86_64                                 6.7.7-100.fc38                                     updates                                 2.6 M
Removing:
 kernel                                               x86_64                                 6.6.11-100.fc38                                    @System                                   0  
 kernel-core                                          x86_64                                 6.6.11-100.fc38                                    @System                                  66 M
 kernel-modules                                       x86_64                                 6.6.11-100.fc38                                    @System                                  56 M
 kernel-modules-core                                  x86_64                                 6.6.11-100.fc38                                    @System                                  31 M
 kernel-modules-extra                                 x86_64                                 6.6.11-100.fc38                                    @System                                 2.4 M

Transaction Summary
==============================================================================================================================================================================================
Install  5 Packages
Remove   5 Packages

Total download size: 111 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): kernel-6.7.7-100.fc38.x86_64.rpm                                                                                                                       554 kB/s | 161 kB     00:00    
(2/5): kernel-core-6.7.7-100.fc38.x86_64.rpm                                                                                                                  6.2 MB/s |  16 MB     00:02    
(3/5): kernel-modules-extra-6.7.7-100.fc38.x86_64.rpm                                                                                                         2.0 MB/s | 2.6 MB     00:01    
(4/5): kernel-modules-core-6.7.7-100.fc38.x86_64.rpm                                                                                                          8.0 MB/s |  33 MB     00:04    
(5/5): kernel-modules-6.7.7-100.fc38.x86_64.rpm                                                                                                                12 MB/s |  59 MB     00:04    
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                          21 MB/s | 111 MB     00:05     
Running transaction check
...

Installed:
  kernel-6.7.7-100.fc38.x86_64 kernel-core-6.7.7-100.fc38.x86_64 kernel-modules-6.7.7-100.fc38.x86_64 kernel-modules-core-6.7.7-100.fc38.x86_64 kernel-modules-extra-6.7.7-100.fc38.x86_64
Removed:
  kernel-6.6.11-100.fc38.x86_64                      kernel-core-6.6.11-100.fc38.x86_64        kernel-modules-6.6.11-100.fc38.x86_64        kernel-modules-core-6.6.11-100.fc38.x86_64       
  kernel-modules-extra-6.6.11-100.fc38.x86_64       

Complete!
# dnf repoquery --installed kernel* --qf="%{name} %{reason}"
(7, "Failed to connect to 127.0.0.1 port 9050 after 201 ms: Couldn't connect to server")
Disabling torproxy plugin: cannot connect to the Tor network
kernel unknown
kernel-core unknown
kernel-headers unknown
kernel-modules unknown
kernel-modules-core unknown
kernel-modules-extra unknown
kernel-srpm-macros dependency

@m-blaha
Copy link
Member

m-blaha commented Mar 8, 2024

I did a quick test on fresh F39 virtual machine where it seems OK. But your case doesn't look all right, indeed.

[root@localhost ~]# dnf repoquery --installed kernel* --qf="%{name}-%{evr} %{reason}"
kernel-6.5.6-300.fc39 user
kernel-core-6.5.6-300.fc39 dependency
kernel-modules-6.5.6-300.fc39 dependency
kernel-modules-core-6.5.6-300.fc39 dependency
[root@localhost ~]# dnf upgrade -q -y "kernel*"
Importing GPG key 0x18B8E74C:
 Userid     : "Fedora (39) <[email protected]>"
 Fingerprint: E8F2 3996 F232 1864 0CB4 4CBE 75CF 5AC4 18B8 E74C
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-39-x86_64

Installed:
  kernel-6.7.7-200.fc39.x86_64             kernel-core-6.7.7-200.fc39.x86_64            
  kernel-modules-6.7.7-200.fc39.x86_64     kernel-modules-core-6.7.7-200.fc39.x86_64    

[root@localhost ~]# dnf repoquery --installed kernel* --qf="%{name}-%{evr} %{reason}"
kernel-6.5.6-300.fc39 user
kernel-6.7.7-200.fc39 user
kernel-core-6.5.6-300.fc39 dependency
kernel-core-6.7.7-200.fc39 dependency
kernel-modules-6.5.6-300.fc39 dependency
kernel-modules-6.7.7-200.fc39 dependency
kernel-modules-core-6.5.6-300.fc39 dependency
kernel-modules-core-6.7.7-200.fc39 dependency

But still - we do not plan to change autoremove command to protect installonly packages, do we?
I'd like to merge this doc PR and file a new one to investigate kernel reasons.

@m-blaha m-blaha added the blocked label Mar 8, 2024
@m-blaha
Copy link
Member

m-blaha commented Mar 8, 2024

Please do not merge it till the installonly packages reason issue is properly investigated.

@j-mracek
Copy link
Contributor Author

j-mracek commented Mar 8, 2024

The trigger of the issue with reasons is removal of one of the installonly packages.

@m-blaha
Copy link
Member

m-blaha commented Mar 12, 2024

@j-mracek I think this is good to go now. Any complaints against removing Blocked label and merging?

@m-blaha m-blaha removed the blocked label Mar 12, 2024
@m-blaha m-blaha merged commit 929d913 into rpm-software-management:master Mar 12, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants