Bug 915692

Summary: zypper can't remove applications "Xfce power manager" and "ca.desrt.dconf-editor"
Product: [openSUSE] openSUSE Distribution Reporter: Jean Delvare <jdelvare>
Component: libzyppAssignee: Michael Schröder <mls>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: bwiedemann, ma
Version: 13.2   
Target Milestone: ---   
Hardware: i686   
OS: openSUSE 13.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Jean Delvare 2015-01-31 11:31:55 UTC
On an openSUSE 13.2 system, zypper lists the following two installed applications as having no match in the package repositories:

i | Xfce power manager    | application | noarch | (System Packages)           
i | ca.desrt.dconf-editor | application | noarch | (System Packages)           

This system was installed with at Beta stage of the distribution, so I suspect that these applications no longer exist in the final product. So I would like to remove them to clean up the output of zypper:

# zypper rm -t application "Xfce power manager" "ca.desrt.dconf-editor"
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following application is going to be installed:
  "dconf Editor" 

The following 2 applications are going to be REMOVED:
  "Xfce power manager" ca.desrt.dconf-editor 

The following 2 packages are going to be reinstalled:
  dconf xfce4-power-manager 

2 packages to reinstall.
Overall download size: 590.6 KiB. Already cached: 0 B  No additional space will be used or freed after the operation.
Continue? [y/n/p/? shows all options] (y): y
Retrieving package dconf-0.22.0-2.3.i586
Retrieving: dconf-0.22.0-2.3.i586.rpm ...[done]
Retrieving package xfce4-power-manager-1.4.1-4.1.i586
Retrieving: xfce4-power-manager-1.4.1-4.1.i586.rpm ...[done]
Checking for file conflicts: ...[done]
(1/2) Installing: dconf-0.22.0-2.3 ...[done]
(2/2) Installing: xfce4-power-manager-1.4.1-4.1 ...[done]

Looks good, however this doesn't work: zypper still lists "Xfce power manager" and "ca.desrt.dconf-editor" as installed applications without a match in the repositories.

How do I get rid of them?
Comment 1 Bernhard Wiedemann 2015-01-31 18:37:23 UTC
you could try
zypper rm -u dconf xfce4-power-manager
Comment 2 Jean Delvare 2015-01-31 20:15:30 UTC
I very much doubt this is a good idea. I don't want to remove these packages, they seem useful. I want to get rid of the ghost applications. I tried your command and zypper basically threatens to get rid of Xfce altogether - 215 packages and 4 patterns to be removed. No, thanks.

I think something is wrong in the package or repository metadata. But I have to admit I don't really understand what "applications" are supposed to be in libzypp context.
Comment 3 Michael Andres 2015-02-02 12:19:29 UTC
(In reply to Jean Delvare from comment #2)
> I think something is wrong in the package or repository metadata. But I have
> to admit I don't really understand what "applications" are supposed to be in
> libzypp context.

See: https://wiki.gnome.org/Initiatives/GnomeGoals/AppDataGnomeSoftware

It looks like we have trouble getting consistent data. My repos are Tumbleweed, but they suffer the same problem.

The appdata.xml.gz file in the repository claims that dconf-0.22.0 will provide an application named 'dconf Editor':

>  <application>
>    <name>dconf Editor</name>
>    ...
>    <id type="desktop">ca.desrt.dconf-editor.desktop</id>

After installation however the installed ca.desrt.dconf-editor.appdata.xml defines no more <name>, so the installed application is named after the file 'ca.desrt.dconf-editor.appdata':

> # rpm -qf /usr/share/appdata/ca.desrt.dconf-editor.appdata.xml 
> dconf-0.22.0-2.1.x86_64
> 
> # cat /usr/share/appdata/dconf-editor.appdata.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <application>
>   <id type="desktop">ca.desrt.dconf-editor.desktop</id>
>   ... defines no <name>


Similar for xfce4-power-manager. The installed /usr/share/appdata/xfce4-power-manager.appdata.xml defines an application named:

> <name>Xfce power manager</name>

The appdata.xml.gz file in the repository however list no application being acssociated with xfce4-power-manager.


The inconsistent repo metadata make the resolver assume, that updateing/reinstalling 'dconf' and 'xfce4-power-manager' will remove the requested applications.
Comment 4 Jean Delvare 2015-02-02 13:24:34 UTC
Thanks for the detailed explanations, Michael.

Isn't appdata.xml.gz generated from the data provided by the packages? If so, the solution would be to regenerate appdata.xml.gz from the packages currently in the repository?
Comment 5 Michael Andres 2015-02-02 13:29:24 UTC
@Dominique: Could you please have a look at dconf/dconf-editor packages.

The /usr/share/appdata/ca.desrt.dconf-editor.appdata.xml seems to be shipped with dconf, but it most probably belongs to dconf-editor as well.

If the appdata.xml provides no <name>, libsolv tries to look into the .desktop file, so preferably both are in the same package. If they were (or if Jean had installed dconf-editor as well), dconf-editor.appdata.xml would have used the correct 'dconf Editor' and removal of application:'dconf Editor' should have succeeded:

> # zypper rm -u -t application 'dconf Editor'
> Loading repository data...
> Reading installed packages...
> Resolving package dependencies...
> 
> The following application is going to be REMOVED:
>   "dconf Editor" 
> 
> The following 4 packages are going to be REMOVED:
>   dconf dconf-editor gsettings-backend-dconf libdconf1 
> 
> 4 packages to remove.


====
'xfce4-power-manager' is a different story. A script extracting the application data from the package produces invalid xml and the data are rejected. That's why the appdata.xml.gz has no entry for xfce4-power-manager'. mls@ is about to fix this in the buildservice.)
Comment 6 Michael Andres 2015-02-02 13:32:01 UTC
@(In reply to Jean Delvare from comment #4)
> so, the solution would be to regenerate appdata.xml.gz from the packages

Usually yes, but here we have one packaging bug and one bug in the ganerator. Both need to be fixed first.
Comment 7 Dominique Leuenberger 2015-02-02 13:52:18 UTC
(In reply to Michael Andres from comment #5)
> @Dominique: Could you please have a look at dconf/dconf-editor packages.
>

> The /usr/share/appdata/ca.desrt.dconf-editor.appdata.xml seems to be shipped
> with dconf, but it most probably belongs to dconf-editor as well.

nice catch - will move the appdata.xml over where it belonges (rule of thumb: the .appdata.xml file always belongs together with a .desktop file; of course their are great exceptions... but a lint check could at least warn for it - might be a follow up action to work on)
Comment 8 Dominique Leuenberger 2015-02-02 13:57:47 UTC
Fir for dconf is submitted to the devel project in SR#283766
Comment 9 Dominique Leuenberger 2015-02-18 14:00:50 UTC
Passing back to Michael; not sure if there was anything else to be done (the dconf issue is fixed)
Comment 10 Swamp Workflow Management 2015-02-22 12:05:01 UTC
openSUSE-RU-2015:0346-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 915692
CVE References: 
Sources used:
openSUSE 13.2 (src):    dconf-0.22.0-5.1
Comment 11 Jean Delvare 2015-02-23 08:42:18 UTC
(In reply to Michael Andres from comment #5)
> 'xfce4-power-manager' is a different story. A script extracting the
> application data from the package produces invalid xml and the data are
> rejected. That's why the appdata.xml.gz has no entry for
> xfce4-power-manager'. mls@ is about to fix this in the buildservice.

Michael, any progress on this?
Comment 12 Michael Schröder 2017-04-26 15:10:14 UTC
I think this is fixed in newer libsolv versions. Closing.