Bug 491

Summary: [zypper] package removal failure
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Qing He <qing.he>
Component: meta-yoctoAssignee: Qing He <qing.he>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, jiajun.xu, ke.yu, kevin.tian, mark.hatle, n3npq, poky.bs.watcher, poky.watcher, richard.purdie, sgw, yi.zhao
Version: 1.0   
Target Milestone: 1.0 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Qing He 2010-10-19 09:28:13 UTC
reproduce step:

$ zypper remove findutils
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following packages are going to be REMOVED:
  findutils findutils-dev task-poky-sdk

3 packages to remove.
After the operation, 595.0 KiB will be freed.
Continue? [y/n/?] (y):
Removing task-poky-sdk-1.0-r5 [error]
Removal of (13124)task-poky-sdk-1.0-r5.armv5te(@System) failed:
Error: Subprocess failed. Error: RPM failed: error: package task-poky-sdk-1.0-r5.armv5te is not installed

Abort, retry, ignore? [a/r/i] (a):
Comment 1 Qing He 2010-10-19 09:30:06 UTC
with --verbose parameter, it shows that

---
...
Check failed:
History:
 - Command exited with status 129.
 - Executing 'lsof' failed (129).
---

but lsof is not installed in the image
Is the missing of lsof causes this bug?
Comment 2 Qing He 2010-10-19 09:44:37 UTC
the rpm command gets called by zypper is something as follow:

   rpm --root / --dbpath /var/lib/rpm -e --allmatches --nodeps -- task-poky-sdk-1.0-r5.armv5te


and rpm reports that "error: package task-poky-sdk-1.0-r5.armv5te" is not installed


while using simply the package name works

   rpm -e task-poky-sdk


While "rpm -qa" shows full name, including version, revision and arch.


Should zypper invokes rpm using simply the package name? or should "rpm -e" accepts full package names?

Cc Mark Hatle
Comment 3 Richard Purdie 2010-10-19 09:45:55 UTC
If installing lsof fixes the problem, it sounds like we need to add lsof to the RDEPENDS of zypper.
Comment 4 Mark Hatle 2010-10-19 09:57:39 UTC
When removing a package it should be valid to list all of the components or simply a subset.. i.e.

rpm -e task-poky-sdk
rpm -e task-poky-sdk-1.0-r5
rpm -e task-poky-sdk-1.0-r5.armv5te


I was able to boot into a target and run similar commands to verify this.

With the commands below added:

--root / --dbpath /var/lib/rpm -e --allmatches --nodeps

it still worked correctly on the target as well.

So I'm not sure how to explain the behavior from Zypper..  If you can figure out a command line reproducer for this we can resolve it.  If not, then we may need to start running things through a debugger.

(If possible, add "-vv" to the command line from Zypper to RPM.. This will add extended debug info that might help...  comparing the output of the -vv from Zypper and from you running the command on the command line yourself might point out the issue)
Comment 5 Qing He 2010-10-19 10:03:06 UTC
(In reply to comment #4)
> When removing a package it should be valid to list all of the components or
> simply a subset.. i.e.
> rpm -e task-poky-sdk
> rpm -e task-poky-sdk-1.0-r5

these two passed in my image, manual execution


> rpm -e task-poky-sdk-1.0-r5.armv5te

this one failed with "error: package xxx is not installed", manual execution

> I was able to boot into a target and run similar commands to verify this.
> With the commands below added:
> --root / --dbpath /var/lib/rpm -e --allmatches --nodeps
> it still worked correctly on the target as well.

Yeah, I think they don't add anything different


Has this anything to do with armv5te and armv5tejl differences (see bug 489)
Comment 6 Qing He 2010-10-19 10:13:17 UTC
(In reply to comment #3)
> If installing lsof fixes the problem, it sounds like we need to add lsof to the
> RDEPENDS of zypper.

a deeper look shows that lsof is used by --verbose functionality of zypper, not zypper itself. It can later be added as an RRECOMMENDS or something
Comment 7 Qing He 2010-10-20 02:05:13 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > When removing a package it should be valid to list all of the components or
> > simply a subset.. i.e.
> > rpm -e task-poky-sdk
> > rpm -e task-poky-sdk-1.0-r5
> 
> these two passed in my image, manual execution
> 
> 
> > rpm -e task-poky-sdk-1.0-r5.armv5te
> 
> this one failed with "error: package xxx is not installed", manual execution
> 

talked with Jiajun, now we can confirm that, the arch is misrepresented in zypper

$ rpm -qa | grep task-poky-sdk
task-poky-sdk-1.0-r5.qemuarm

but zypper recognized them all as armv5te
Comment 8 Qing He 2010-10-20 17:54:58 UTC
see also bug 498

The issues seem related but distinct
Comment 9 Jeff Johnson 2010-10-27 11:40:51 UTC
Tracked at https://bugs.launchpad.net/rpm/+bug/667407
Comment 10 Ke Yu 2010-12-08 22:36:40 UTC
wait for zypper and rpm usability enhancement complete
Comment 11 Qing He 2011-02-15 00:49:25 UTC
move to M4 due to the image instabilities before end of M3
Comment 13 Yi Zhao 2011-03-23 00:16:29 UTC
Verify the bug with 20110318 gold build, it is fixed.

The commit number is 82af8b9fb6d6d1439943fd15b8a75c0e663e4a45.