Bug 2014103

Summary: anaconda writes incorrect yum.conf entry with repo --includepkgs option
Product: Red Hat Enterprise Linux 8 Reporter: Steve Traylen <steve.traylen>
Component: anacondaAssignee: Radek Vykydal <rvykydal>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact: Sagar Dubewar <sdubewar>
Priority: unspecified    
Version: CentOS StreamCC: bstinson, jcastran, jikortus, jkonecny, jstodola, jwboyer, peter, rvykydal, sdubewar, vponcova
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: anaconda-33.16.8.6-1.el8 Doc Type: Bug Fix
Doc Text:
.The installer now adds configuration options correctly into the yum repo files Previously, the installer did not add configuration options correctly into yum repo files while including and excluding packages from additional installation repositories. With this update, yum repo files are created correctly. As a result, using the `--excludepkgs=` or `--includepkgs=` options in the `repo` kickstart command now excludes or includes the specified packages during installation as expected.
Story Points: ---
Clone Of:
: 2158210 (view as bug list) Environment:
Last Closed: 2023-05-16 08:15:29 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:

Description Steve Traylen 2021-10-14 13:36:39 UTC
Description of problem:

A kickstart file line such as 

   repo --name="CCOS" --baseurl http://linuxsoft.example.org/cern/centos/8/x86_64 --includepkgs=foo


creates a yum repo with configuration.


   [CCOS]
   baseurl=http://linuxsoft.example.org/cern/centos/8/x86_64
   include=foo


That `include` parameter to dnf is not correct and it should be `includepkgs`




Version-Release number of selected component (if applicable):
anaconda-33.16.4.15-1.el8.0.2.x86_64

How reproducible:
Everytime

Steps to Reproduce:
1. use `repo --name="CCOS" --baseurl http://linuxsoft.example.org/cern/centos/8/x86_64 --includepkgs=foo`
2. All packages from CCOS repo will be installable
3.

Actual results:
All packages from CCOS repo will be installable.


Expected results:
Only exactly the `foo` package should be installable.


Additional info:

From yum.conf manpage - dnf-4.4.2-11.el8.noarch, yum-4.4.2-11.el8.noarch


excludepkgs
              list

Exclude  packages  of  this  repository,  specified  by a name or a glob
and separated by a comma, from all operations.


and 

includepkgs
       list

Include  packages of this repository, specified by a name or a glob and
separated by a comma, in all operations.  Inverse of excludepkgs, DNF will
exclude any package in the repository that doesn't match this list.


The include or exclude is written here:

https://github.com/rhinstaller/anaconda/blob/rhel-8/pyanaconda/payload/dnf/payload.py#L2029

so in fact both the include and exclude are incorrect as it should be
includepkgs or excludepkgs in yum.conf however I believe that 'exclude'
on it's own is still accepted by dnf.

Comment 3 Radek Vykydal 2023-01-04 14:36:29 UTC
(In reply to Vendula Poncova from comment #1)
> This issue was fixed upstream during the modularization of the DNF payload.
> We track the RHEL 8 and 9 bug also here:
> https://github.com/rhinstaller/kickstart-tests/issues/670

PR with the proposed fix:
https://github.com/rhinstaller/anaconda/pull/4488
makes the kickstart test (repo-include) pass.

Comment 7 Jan Stodola 2023-01-13 16:24:59 UTC
Checked that anaconda-33.16.8.6-1.el8 is in nightly compose RHEL-8.8.0-20230113.0

Moving to VERIFIED

Comment 9 Jan Stodola 2023-02-02 12:00:55 UTC
*** Bug 1879626 has been marked as a duplicate of this bug. ***

Comment 11 errata-xmlrpc 2023-05-16 08:15:29 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 (anaconda 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/RHBA-2023:2748