Bug 2065314

Summary: Demote netcat to Recommends
Product: Red Hat Enterprise Linux 8 Reporter: Stephen Hobbs <shobbs>
Component: libvirtAssignee: Andrea Bolognani <abologna>
Status: CLOSED ERRATA QA Contact: yalzhang <yalzhang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.7CC: abologna, jdenemar, lmen, lmiksik, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-8.0.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2067176 (view as bug list) Environment:
Last Closed: 2022-05-10 13:26:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2067176    

Description Stephen Hobbs 2022-03-17 16:15:29 UTC
Description of problem: Curently libvirt requires the nmap-ncat package to be installed as a dependency.  My customer would like the ability to remove this package.

Currently this is a issue for their Satellite installation as the foreman-libvirt packages are requiring the nmap-ncat install as well.


Additional info:

On Fri, Dec 24, 2021 at 02:27:45AM -0800, Andrea Bolognani wrote:
> On Fri, Dec 24, 2021 at 01:45:13AM -0800, Andrea Bolognani wrote:
> > In the more immediate,
> > perhaps we could demote the Requires on netcat to a Recommends?
> > Assuming those work roughly the same as the Debian equivalent, the
> > result would be that netcat is installed by default but it's possible
> > to uninstall it without the package manager yelling at you.
>
> Upstream patch:
>
>   https://listman.redhat.com/archives/libvir-list/2021-December/msg00895.html

Merged upstream:

  commit cac854e4d4819574b684c1690a1756d5a19fcb17
  Author: Andrea Bolognani <abologna>
  Date:   Fri Dec 24 10:56:04 2021 +0100

    spec: Demote netcat to Recommends

    It is only needed if compatibility with clients that have
    libvirt < 6.9.0 is required, and can be uninstalled otherwise.

    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Martin Kletzander <mkletzan>

  v7.10.0-383-gcac854e4d4

It will be included in libvirt 8.0.0, which is due to be released
later this month and will be included in RHEL 8.6 as well as RHEL
9.0.

Comment 2 Jiri Denemark 2022-03-18 08:53:11 UTC
Included in a RHEL 8.6.0 build made two months ago.

Comment 4 yalzhang@redhat.com 2022-03-21 03:59:15 UTC
Reproduced it on libvirt-7.6.0-6.module+el8.5.0+13051+7ddbe958.x86_64
# rpm -q libvirt 
libvirt-7.6.0-6.module+el8.5.0+13051+7ddbe958.x86_64

# yum remove nmap-ncat
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Dependencies resolved.
=============================================================================================================================================================================
 Package                                             Architecture    Version                                                                Repository                  Size
=============================================================================================================================================================================
Removing:
 nmap-ncat                                           x86_64          2:7.70-6.el8                                                           @beaker-AppStream          480 k
Removing dependent packages:
 gnome-boxes                                         x86_64          3.36.5-8.el8                                                           @beaker-AppStream          6.3 M
 libguestfs                                          x86_64          1:1.44.0-3.module+el8.5.0+10681+17a9b157                               @ci                        4.5 M
 libvirt                                             x86_64          7.6.0-6.module+el8.5.0+13051+7ddbe958                                  @ci                          0  
 libvirt-daemon-driver-storage-core                  x86_64          7.6.0-6.module+el8.5.0+13051+7ddbe958                                  @ci                        712 k


And test on libvirt-8.0.0-5.module+el8.6.0+14480+c0a3aa0f.x86_64
# yum remove nmap-ncat
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Dependencies resolved.
===============================================================================
 Package         Architecture Version            Repository               Size
===============================================================================
Removing:
 nmap-ncat       x86_64       2:7.70-6.el8       @beaker-AppStream
...

The result is as expected.

Comment 10 yalzhang@redhat.com 2022-03-24 11:13:34 UTC
Test on libvirt-8.0.0-5.module+el8.6.0+14480+c0a3aa0f.x86_64, the result is as expected.

1. On fresh installed rhel 8.6 host, remove the nmap-ncat package;
2. Install the libvirt packages, check the nmap-ncat is not installed by dependencies;

Comment 11 Stephen Hobbs 2022-03-25 18:23:24 UTC
Hello, 

Followup question on this request.  Will this change be filtered down to other "libvirt" packages, or will a RFE need to be opened for each one of those.  The nmap-ncat package shows as a dependency of other packages as well.

This was determine by trying to remove the package from a system running Red Hat Satellite.

# rpm -e nmap-ncat
error: Failed dependencies:
	nc is needed by (installed) libvirt-libs-4.5.0-36.el7_9.5.x86_64

# rpm -e libvirt-libs
error: Failed dependencies:
        libvirt-lxc.so.0()(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt-lxc.so.0(LIBVIRT_LXC_1.0.2)(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt-lxc.so.0(LIBVIRT_LXC_1.0.4)(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt-qemu.so.0()(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt-qemu.so.0(LIBVIRT_QEMU_0.10.0)(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt-qemu.so.0(LIBVIRT_QEMU_0.8.3)(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt-qemu.so.0(LIBVIRT_QEMU_0.9.4)(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt.so.0()(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
        libvirt.so.0(LIBVIRT_0.0.3)(64bit) is needed by (installed) tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64

# rpm -e tfm-rubygem-ruby-libvirt-0.7.1-1.el7sat.x86_64
error: Failed dependencies:
	tfm-rubygem(ruby-libvirt) >= 0.6.0 is needed by (installed) foreman-proxy-2.3.1-1.el7sat.noarch
	tfm-rubygem(ruby-libvirt) >= 0.7.0 is needed by (installed) tfm-rubygem-fog-libvirt-0.7.0-1.el7sat.noarch
	tfm-rubygem(ruby-libvirt) >= 0.5 is needed by (installed) foreman-libvirt-2.3.1.25-2.el7sat.noarch
	tfm-rubygem(ruby-libvirt) < 1.0 is needed by (installed) foreman-libvirt-2.3.1.25-2.el7sat.noarch

Comment 12 Andrea Bolognani 2022-03-28 12:13:53 UTC
(In reply to Stephen Hobbs from comment #11)
> Will this change be filtered down to
> other "libvirt" packages, or will a RFE need to be opened for each one of
> those.  The nmap-ncat package shows as a dependency of other packages as
> well.

From the output you provided, it look like an *indirect* dependency:
foreman depends on libvirt-ruby which depends on libvirt which
depends on netcat.

Put it another way: aside from libvirt, there is no package in the
dependency chain that depends on netcat directly. So no need for
further bugs to be filed.

> This was determine by trying to remove the package from a system running Red
> Hat Satellite.
> 
> # rpm -e nmap-ncat
> error: Failed dependencies:
> 	nc is needed by (installed) libvirt-libs-4.5.0-36.el7_9.5.x86_64

Note that the first version of libvirt that contains the fix is
8.0.0-1 (RHEL 8.6) and you seem to have 4.5.0-36 (RHEL 7.9). You
won't benefit from the fix until you are running a version of
Satellite that is based on RHEL 8.6 and uses the corresponding
version of libvirt.

Comment 14 errata-xmlrpc 2022-05-10 13:26:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:1759