Installing packages fails when launched via Firefox ("open with")

Bug #1749728 reported by APolihron
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
gdebi (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When launched from Firefox with the "open with" function, GDebi is unable to complete installing the package. The GDebi window does open, but after selecting to "install" the package the window closes and the package is left uninstalled.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gdebi 0.9.5.7+nmu2
ProcVersionSignature: Ubuntu 4.13.0-32.35-generic 4.13.13
Uname: Linux 4.13.0-32-generic x86_64
ApportVersion: 2.20.8-0ubuntu10
Architecture: amd64
CurrentDesktop: MATE
Date: Thu Feb 15 17:08:31 2018
InstallationDate: Installed on 2018-02-15 (0 days ago)
InstallationMedia: Ubuntu-MATE 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180215)
PackageArchitecture: all
SourcePackage: gdebi
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
APolihron (apolitech) wrote :
summary: - GDebi doesn't handle apturl
+ GDebi doesn't handle Firefox "open with"
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: GDebi doesn't handle Firefox "open with"

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdebi (Ubuntu):
status: New → Confirmed
Jani Uusitalo (uusijani)
description: updated
summary: - GDebi doesn't handle Firefox "open with"
+ Installing packages fails when launched via Firefox ("open with")
Revision history for this message
William Geiger (whgiii-q) wrote :

I am experiencing the same behavior in Xubuntu 18.04 (has been a problem for a while) when using "open with" on the .deb package from Thunar (right mouse menu). If I start gdebi-gtk from the command line and use the "file open" menu option then everything works ok.

I will dig through my logs for more info.

This system is a fresh install of 18.04 Gdebi was the 5th package installed after (gnumeric, gppoder, synaptic, vlc).

Revision history for this message
William Geiger (whgiii-q) wrote :

I finally got around to tracking down this problem it seems to be a mimeinfo.cache issue.

If the reader is not familiar mimeinfo is part of the freedesktop and contains all the mime types and their program associations.

for deb packages the primary mime type (called media types now because why not <sigh>} is:

application/vnd.debian.binary-package

with 2 depreciated alternates:

application/x-deb
application/x-debian-package

this is documented @ https://www.iana.org/assignments/media-types/application/vnd.debian.binary-package

the entire mime list is @ http://www.iana.org/assignments/media-types/

these definitions are combined with default applications and put into defaults.list file(s). On my system I have several <sigh>. They are located @:

/etc/g/etc/xfce4/defaults.list
nome/defaults.list
/usr/share/applications/defaults.list
/usr/share/xfce4/applications/defaults.list
/usr/share/xubuntu/applications/defaults.list

now I am not 100% but I believe that the mimeinfo.cache file is created from the default.list (God only knows which one) and updated every time a program/package is installed. This is all part of the Freedesktop/xdg stuff and you can read the docs/specs @ their website.

 On my system I have 2 of these files:

/usr/share/applications/mimeinfo.cache
/home/johndoe/.local/share/applications/mimeinfo.cache

to "fix" the problem with launching gdebi from the Thunar context menu (right mouse menu) I edited the /usr/share/applications/mimeinfo.cache file so the only app association with the deb packages was gdebi.desktop (and of course there are multiple of these on my system <sigh>):

application/vnd.debian.binary-package=gdebi.desktop;
application/x-deb=gdebi.desktop;
application/x-debian-package;

I also modified my in the same manner but it seems that the file in /usr/share/applications/mimeinfo.cache is the critical one for Thunar,

To get Gdebi to work from the opera downloads via open downloaded .deb file I had to add the mime associations to /home/johndoe/.config/mimeapps.list (yea! another MIME file)

Now there is yet another MIME file /usr/share/mime/mime.cache which is a binary file. It can be updated via the command:

$ sudo update-mime-database /usr/share/mime/

I don't know who or what uses it but I am at the tail end of an all-nighter hunting down this bug so I updated it.

There is one more file that should be looked at:

/usr/share/application-registry/gdebi.applications

the last line in the file is:

mime_types=application/x-deb

I changed it to:

mime_types=application/x-deb;application/vnd.debian.binary-package;application/x-debian-package;

not sure if it matters nor if it should be comma separated or semi-colon separated perhaps the package maintainer can chime in.

I hope this is somewhat helpful. If you are reading this and NOT on an xubuntu system you file locations may be different. use your favorite file search utility (I use catfish) and look for "mimeinfo", "defaults.list", "mime", and "gdebi"

Revision history for this message
William Geiger (whgiii-q) wrote :

after some sleep I have a couple of additional comments:

the /usr/share/application-registry/gdebi.applications file the mime list should be comma-delimited or at least that is what they did in the liboffice.application file (it is the only other file in the directory).

while the steps in my previous post got gdebi to work from Thunar & Opera it DID NOT fix Firefox.

For firefox the only thing I have found to work was to set Terminal=true in the gdebi.desktop file. If you have multiple copies of this file make sure you change the one in:

/usr/share/applications/gdebi.desktop:

I have one at:

/home/johndoe/.local/share/applications/gdebi.desktop

it was created by trying to edit via the Whisker Menu

I have another one at:

/home/johndoe/.local/share/applications/gdebi.desktop

it was created by trying to edit via MenuLibre <sigh>

if anyone whishes to contact me they can do so @ <email address hidden>

Revision history for this message
William Geiger (whgiii-q) wrote :

from my auth.log file:

before modifying the terminal flag in gdebi.desktop

Jul 8 15:20:46 johndoe-Latitude-D630 polkitd(authority=local): Operator of unix-session:c2 FAILED to authenticate to gain authorization for action com.ubuntu.pkexec.gdebi.gtk for unix-process:998:23188 [/lib/systemd/systemd --user] (owned by unix-user:johndoe)

Jul 8 15:20:46 johndoe-Latitude-D630 pkexec[4230]: johndoe: Error executing command as another user: Request dismissed [USER=root] [TTY=unknown] [CWD=/home/johndoe/tmp] [COMMAND=/usr/bin/gdebi-gtk --non-interactive /home/johndoe/tmp/mozilla_johndoe0/ghex_3.18.3-3_amd64.deb]

after modifying the terminal flag in gdebi.desktop

Jul 8 15:35:26 johndoe-Latitude-D630 polkitd(authority=local): Operator of unix-session:c2 successfully authenticated as unix-user:johndoe to gain ONE-SHOT authorization for action com.ubuntu.pkexec.gdebi.gtk for unix-process:5533:234898 [/usr/lib/firefox/firefox] (owned by unix-user:johndoe)

Jul 8 15:35:26 johndoe-Latitude-D630 pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1000)

Jul 8 15:35:26 johndoe-Latitude-D630 pkexec[5699]: johndoe: Executing command [USER=root] [TTY=unknown] [CWD=/home/johndoe] [COMMAND=/usr/bin/gdebi-gtk --non-interactive /home/johndoe/tmp/mozilla_johndoe0/ghex_3.18.3-3_amd64.deb]

Revision history for this message
LE BIDEAU (elbc) wrote :

any news on this bug ? very annoying ....

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.