.deb files open with Archive Manager by default

Bug #1970248 reported by Jeremy Bícha
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
desktop-file-utils (Baltix)
Confirmed
High
Mantas Kriaučiūnas
gnome-session (Ubuntu)
Fix Released
High
Unassigned
Jammy
Confirmed
High
Jeremy Bícha

Bug Description

Impact
------
Someone who downloads a .deb file usually wants to install the .deb when they open it. Opening it with Archive Manager is really confusing.

Test Case
---------
Download a .deb
Open your Downloads folder with the file manager.
Double click on the .deb
The Ubuntu Software app should open with a button that says Install.

More Details
------------
desktop-file-utils provides /etc/gnome/defaults.list
In that file, there is this line (and several other lines also referring to the same .desktop)

application/vnd.debian.binary-package=snap-store_ubuntu-software-local-file.desktop

But when I look at /snap/snap-store/575/usr/share/applications/
there is gnome-software-local-file.desktop

which is a different file name.

I believe this issue can be fixed in either snap-store or with desktop-file-utils.

Tags: jammy
Jeremy Bícha (jbicha)
Changed in snap-store-desktop:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Ken VanDine (ken-vandine) wrote :

defaults.list is referencing the correct desktop file. It's installed in /var/lib/snapd/desktop/applications/snap-store_ubuntu-software-local-file.desktop

I don't know why it's not the default though, perhaps alphabetical in the picker?

Revision history for this message
Jeremy Bícha (jbicha) wrote :

$ mimeopen -D gnome-control-center_1%3a41.4-1ubuntu13_amd64.deb
> Data dirs are: /home/jeremy/.local/share, /usr/share/ubuntu, /usr/local/share, /usr/share, /var/lib/snapd/desktop
> Checking inode type
> Checking globs for basename 'gnome-control-center_1%3a41.4-1ubuntu13_amd64.deb'
> Checking for extension '.deb'
Opening "gnome-control-center_1%3a41.4-1ubuntu13_amd64.deb" with Archive Manager (application/vnd.debian.binary-package)

Beginning of the Fix
====================
1. Add application/vnd.debian.binary-package;
to the MimeType line of
snap-store_ubuntu-software-local-file.desktop

2. Then run
sudo update-desktop-database /var/lib/snapd/desktop/applications

$ mimeopen -D gnome-control-center_1%3a41.4-1ubuntu13_amd64.deb
> Data dirs are: /home/jeremy/.local/share, /usr/share/ubuntu, /usr/local/share, /usr/share, /var/lib/snapd/desktop
> Checking inode type
> Checking globs for basename 'gnome-control-center_1%3a41.4-1ubuntu13_amd64.deb'
> Checking for extension '.deb'
Please choose a default application for files of type

 1) Archive Manager (org.gnome.FileRoller)
 2) Software Install (snap-store_ubuntu-software-local-file)
 3) Other...

use application #

That got me a step closer but then it looks like at least mimeopen isn't sure which app to use.

Revision history for this message
Mantas Kriaučiūnas (mantas) wrote (last edit ):

GNOME 40 and newer doesn't use /usr/share/applications/defaults.list file, I think this is the main issue why deb files are opened by Archive Manager, for more info look at

https://help.gnome.org/admin/system-admin-guide/stable/mime-types-application.html.en

Quick fix could be to change the name of /usr/share/applications/defaults.list symlink to mimeapps.list , but I'm not 100% sure, because there is a line in /usr/share/applications/gnome-mimeapps.list
application/x-deb=org.gnome.FileRoller.desktop

The /usr/share/applications/mimeapps.list and /usr/share/applications/gnome-mimeapps.list files specify which application is registered to open specific MIME types by default. These files are provided by the distribution.

To override the system defaults for all users on the system, you need to create a /etc/xdg/mimeapps.list or /etc/xdg/gnome-mimeapps.list file with a list of MIME types for which you want to override the default registered application.

Files located in /etc/xdg/ take precedence over files found in /usr/share/applications/. Additionally, /etc/xdg/gnome-mimeapps.list takes precedence over /etc/xdg/mimeapps.list

Btw, there is a bug #1559129 (Replace defaults.list by mimeapps.list) already reported few years ago by Ubuntu developer, but it seems someone forgot to fix that :(

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Manatas, do you have more detail about when you think the behavior changed?

Revision history for this message
Sebastien Bacher (seb128) wrote :

The defaults.list handling is still valid,
https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/gdesktopappinfo.c#L985

The issue is that it ranks lower than gnome-mimeapps.list which got install by error since a gnome-session merge this cycle
http://launchpadlibrarian.net/569661464/gnome-session_40.1.1-1ubuntu1_40.1.1-3ubuntu1.diff.gz

the
>- don't install gnome-mimeapps.list (installed by desktop-file-utils in Ubuntu)

was undone there
+debian/gnome-mimeapps.list usr/share/applications/

or that list isn't customized by Ubuntu and taking over our defaults

affects: desktop-file-utils (Ubuntu) → gnome-session (Ubuntu)
Changed in gnome-session (Ubuntu Jammy):
assignee: nobody → Jeremy Bicha (jbicha)
Revision history for this message
Sebastien Bacher (seb128) wrote :

We should revisit how we ship the default going forward, at least use the non deprecated filename. The reason we ship from desktop-file-utils was that it was a smaller and less risky package to upload to change default.

But for now the first fix would probably be to remove the .install line from gnome-session again

Revision history for this message
Sebastien Bacher (seb128) wrote :

bug #1559129 is also a report about replacing the outdated default.list which we should do next cycle

Jeremy Bícha (jbicha)
Changed in gnome-session (Ubuntu):
status: Triaged → Fix Committed
Jeremy Bícha (jbicha)
Changed in gnome-session (Ubuntu Jammy):
status: Triaged → In Progress
no longer affects: snap-store-desktop
Changed in gnome-session (Ubuntu Jammy):
status: In Progress → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

Missing 'where problems could occur' per https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

And I do see significant risk of problems; while the mime handler for .deb files is incorrect, a diff of /etc/gnome/defaults.list vs /usr/share/applications/gnome-mimeapps.list shows a number of differences, including some types that are only handled in /usr/share/applications/gnome-mimeapps.list. Given that shipping /usr/share/applications/gnome-mimeapps.list was unintentional and it's so soon after release we might accept wholesale dropping of the file, however I would still want to see analysis of the impact.

Changed in gnome-session (Ubuntu Jammy):
status: Fix Committed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-session - 42.0-1ubuntu3

---------------
gnome-session (42.0-1ubuntu3) kinetic; urgency=medium

  * debian/gnome-session-common.install: Don't install gnome-mimeapps.list
    (installed by desktop-file-utils in Ubuntu) (LP: #1970248)
  * Have gnome-session and ubuntu-session depend on
    xdg-desktop-portal-gnome | xdg-desktop-portal-backend (LP: #1970424)

 -- Jeremy Bicha <email address hidden> Sun, 01 May 2022 11:35:12 -0400

Changed in gnome-session (Ubuntu):
status: Fix Committed → Fix Released
Changed in gnome-session (Ubuntu Jammy):
status: Incomplete → Confirmed
Changed in desktop-file-utils (Baltix):
assignee: nobody → Mantas Kriaučiūnas (mantas)
status: New → Confirmed
importance: Undecided → High
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.