Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1686693 - "yumdb set installonly keep pkgname-version" prevents removal of other versions and completely fails after yumdb del.
Summary: "yumdb set installonly keep pkgname-version" prevents removal of other versio...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-08 03:00 UTC by BugMasta
Modified: 2019-03-08 03:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description BugMasta 2019-03-08 03:00:36 UTC
Description of problem:

"yumdb set installonly keep pkgname-version" prevents removal of other versions, and sometimes does not work AT ALL.

Version-Release number of selected component (if applicable):
yum-3.4.3-161.el7

How reproducible:

Steps to Reproduce:

1.Remove any up-to-date version of Java

2.Add to yum.conf: 
    installonlypkgs=java-1.8.0-openjdk-headless

3.Install two old versions of Java, eg:
    yum install java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64
    yum install java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64

4.Check Javas
    rpm -qa | grep java-1.8.0-openjdk-headless
    java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64
    java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64

5.Remove from yum.conf:
    #installonlypkgs=java-1.8.0-openjdk-headless

6.Set yumdb installonly flag on just one of our two old Javas:
    yumdb set installonly keep java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64

7.Check yumdb installonly flag:
  yumdb get installonly java-1.8.0-openjdk-headless

Loaded plugins: product-id, rhnplugin, subscription-manager, susemanagerplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
1:java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64
     installonly = keep
1:java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64
     installonly <unset>

8.yum update

Actual results:
New Java is installed:
Installing : 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el7_6.x86_64 

Expected results:
New Java is installed, and the old Java with installonly UNSET, should be removed, keeping only the version with installonly=keep

Additional info:

After doing yumdb del, to delete the installonly flag, the results are even more appalling:

9. yumdb del installonly java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64

10.yumdb get installonly java-1.8.0-openjdk-headless
Loaded plugins: product-id, rhnplugin, subscription-manager, susemanagerplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
1:java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64
     installonly <unset>
1:java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64
     installonly <unset>

11. yum update
...
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.201.b09-2.el7_6 will be installed

And neither one of the old packages is removed, even though they do not have installonly set to keep!


Note You need to log in before you can comment on or make changes to this bug.